1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
James Lawrance Lab 3 Output / Work
---------------------------
5a -
6.4 Exercises -
0
2
3
2
1
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 8936) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
7.1 Exercises -
1. int_exp1 => int_exp2
^ >= is the correct syntax, not =>
2. int_exp1 = int_exp2
^ == is the correct syntax, not =
3. int_exp1 =! int_exp2
^ != is the correct syntax, not =!
4. char_exp == "A"
^ since the variable char_exp is stored as a character, 'A' should be typed instead
5. int_exp1 > char_exp
^ characters do not have numerical values, therefore the comparison does not make sense
6. int_exp1 < 2 && > -10
^ incorrect syntax, the && can be omitted
7.2 Exercises -
What is your balance?
11000
How many accounts do you have open with us?
1
Your membership is Silver
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 4776) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
5b -
7.4 Exercises -
Student Grade Program
- Main Menu -
1. Enter name
2. Enter test scores
3. Display test scores
9. Exit
Please enter your choice from the list above 9
Exit
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 19648) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
5c -
7.10 Exercises #2 -
pseudocode -
Input amount of loan($###)
Input interest rate
IF interest rate isn't 1-18% of loan
print error message and exit
IF amount of loan isn't between $100 - $1000
print error message and exit
If loan is between $100 and $500
fee = $20
If loan is greater than $500
fee = $25
printer interest rate * amount of loan, interest rate, (interest rate * amount of loan) + fees
output 1 -
Enter the amount of your loan
400
Enter the interest rate
12
The total amount of interest due is 4800
The interest rate is 12
The total amount of interest and fees due is 4820
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 3556) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
output 2 -
Enter the amount of your loan
700
Enter the interest rate
18
The total amount of interest due is 12600
The interest rate is 18
The total amount of interest and fees due is 12625
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 14408) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
output 3 -
Enter the amount of your loan
0
Enter the interest rate
10
Error: invalid loan amount
C:\Users\there\Source\Repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 12340) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Section 8.4 #1 pseudocode -
Average Test Scores Program
Input number of Assignments
Loop asking for scores
Average Test Scores = Scores/Assignments
Print Average Test Scores
Section 8.4 #1 output -
Enter the number of assignments
7
Enter the score for Assignment #1
100
Enter the score for Assignment #2
100
Enter the score for Assignment #3
98
Enter the score for Assignment #4
88
Enter the score for Assignment #5
75
Enter the score for Assignment #6
73
Enter the score for Assignment #7
73
The average score of these 7 assignments is 86.7143
Section 8.4 #2 output -
Base length?
16
****************
***************
**************
*************
************
***********
**********
*********
********
*******
******
*****
****
***
**
*
C:\Users\there\source\repos\cst116-lab3-JEmersonLawrance\x64\Debug\CST116F2021-Lab3.exe (process 5076) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Section 8.10 #3 -
output 1-
Where would you like your Fibonacci sequence to terminate?
20
1 1 2 3 5 8 13
output 2-
Where would you like your Fibonacci sequence to terminate?
5000
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
6a -
6.5 Exercises -
1. a += 25
2. b *- (a * 2)
3. ++b
4. c %= 5
5. b /= a
Section 8.2 #1 -
output 1 -
Welcome to the descending even number program.
Please enter an integer between 1 and 50
50
The number you have entered is not between 1 and 50. Try again.
output 2 -
Welcome to the descending even number program.
Please enter an integer between 1 and 50
15
15
14 12 10 8 6 4 2 0
Section 8.3 #1 output-
Welcome to the descending even number program.
Please enter an integer between 1 and 50
0
You have not entered an integer between 1 and 50. Please try again.
100
You have not entered an integer between 1 and 50. Please try again.
14
14 12 10 8 6 4 2
0
|