You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: labs/GradeCalculator/readme.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ title: Grade Calculator
5
5
This lab serves multiple goals:
6
6
7
7
- To have you read a high-level description of a program,
8
-
- To help you in implementing this high-level description,
8
+
- To help you implement this high-level description,
9
9
- To help you structure your reasoning and mathematical understanding of a simple problem,
10
10
- To exhibit different implementations of this high-level description.
11
11
@@ -22,35 +22,35 @@ We will assume that your grade for this class will be computed as follows:
22
22
In-class Tests 2 100 40%
23
23
Final Exam 1 200 40%
24
24
25
-
Our goal is to write a program that asks the user for their grades obtained *so far* (it is possible that some quizzes, projects, tests are still to be taken, or that the final did not happened yet) and compute their *current* class average.
25
+
Our goal is to write a program that asks the user for their grades obtained *so far* (it is possible that some quizzes, projects, and tests are still to be taken, or that the final has not happened yet) and computes their *current* class average.
26
26
27
-
Your program can either ask the user for the number of quizzes, projects, test and exam taken so far, and then ask for the values, or use a sentinel value (as shown in the example below) to know when to "stop".
27
+
Your program can either ask the user for the number of quizzes, projects, tests, and exams taken so far, and then ask for the values, or use a sentinel value (as shown in the example below) to know when to "stop".
28
28
This means if they say that they have taken only 2 quizzes (or put the sentinel value for quiz 3), then the program should not ask for the later quiz grades (this is also true for the projects and exams).
29
-
It is fine to assume that the user will only enter "correct" numerical values and not to perform any user-input validation, but your program should be flexible enough so that changing the number of quizzes, for instance, would require to change only a variable or a couple of values.
29
+
It is fine to assume that the user will only enter "correct" numerical values, and you will not need to perform any user-input validation, but your program should be flexible enough so that changing the number of quizzes, for instance, would require changing only a variable or a couple of values.
30
30
31
31
An example of execution could be:
32
32
33
33
```{.text}
34
34
For all the questions below, enter
35
35
- your grade, or
36
36
- "0" if you missed the evaluation, or
37
-
- "-1" if that evaluation did not happened yet.
37
+
- "-1" if that evaluation has not happened yet.
38
38
39
-
What was your grade for quiz 1 (out of 20)?
39
+
What was your grade for Quiz 1 (out of 20)?
40
40
1̲6̲↵
41
-
What was your grade for quiz 2 (out of 20)?
41
+
What was your grade for Quiz 2 (out of 20)?
42
42
1̲4̲↵
43
-
What was your grade for quiz 3 (out of 20)?
43
+
What was your grade for Quiz 3 (out of 20)?
44
44
-̲1̲↵
45
45
Your average for the quiz is 75.00 %.
46
-
What was your grade for project 1 (out of 20)?
46
+
What was your grade for Project 1 (out of 20)?
47
47
2̲2̲↵
48
-
What was your grade for project 2 (out of 20)?
48
+
What was your grade for Project 2 (out of 20)?
49
49
-̲1̲↵
50
50
Your average for the project is 110.00 %.
51
-
What was your grade for in-class test 1 (out of 100)?
51
+
What was your grade for Test 1 (out of 100)?
52
52
6̲6̲↵
53
-
What was your grade for in-class test 2 (out of 100)?
53
+
What was your grade for Test 2 (out of 100)?
54
54
-̲1̲↵
55
55
Your average for the tests is 66.00 %.
56
56
What was your grade for the final (out of 200)?
@@ -75,7 +75,7 @@ Once you have the equation figured out, you need to understand how you can obtai
75
75
You have two possible ways of doing it:
76
76
77
77
- Will you ask first for the number of quizzes taken, and then ask for the values, or
78
-
- Will you ask for the values, and take "-1", for instance, as a signal that this quiz did not happened yet.
78
+
- Will you ask for the values, and take "-1", for instance, as a signal that this quiz has not happened yet?
79
79
80
80
Try to implement one or the other, without worrying about the computation at this point (just add, for instance, the value entered).
81
81
@@ -91,4 +91,4 @@ However, the solution is flexible enough (and, hopefully, commented enough) so t
91
91
## With arrays
92
92
93
93
Another solution to this problem is in [Grade_Calculator_with_Arrays](Grade_Calculator_with_Arrays.zip).
94
-
This solution is much more flexible, uses fewer variable, but it may also be more difficult to understand, because it uses arrays in a subtle way.
94
+
This solution is much more flexible and uses fewer variables, but it may also be more difficult to understand because it uses arrays in a subtle way.
0 commit comments