-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathgradeCalc_2.cpp
162 lines (117 loc) · 5.53 KB
/
gradeCalc_2.cpp
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
//*****************************************************************************************************
// Computer Programming I Grade Calculator
//
// This program is a grade calculator for a Computer Programming I class that uses functions.
//
//*****************************************************************************************************
#include <iostream>
using namespace std;
//*****************************************************************************************************
void readGrades(float &, float &, float &, float &);
void calcWeights(float &, float &, float &, float &, float, float, float, float);
float calcFind(float, float, float, float);
void displayResults(float);
//*****************************************************************************************************
int main() {
const int ASSIGN_PERCENT = 15,
TEST_PERCENT = 50,
EXAM_PERCENT = 30,
PARTIC_PERCENT = 5;
float assign,
test,
exam,
partic,
finalGrade;
cout << "Grade Calculator - Computer Programming I" << endl;
cout << "\nThe weight of each deliverable on their final grade\n\n"
<< "\tProgrammig Assignments: " << ASSIGN_PERCENT << "%\n"
<< "\tChapter Tests: " << TEST_PERCENT << "%\n"
<< "\tFinal Exam: " << EXAM_PERCENT << "%\n"
<< "\tClass Participation: " << PARTIC_PERCENT << "%" << endl;
readGrades(assign, test, exam, partic);
calcWeights(assign, test, exam, partic, ASSIGN_PERCENT, TEST_PERCENT, EXAM_PERCENT, PARTIC_PERCENT);
finalGrade = calcFind(assign, test, exam, partic);
cout << "\n\t" << assign << "% in Programming Assignments"
<< "\n\t" << test << "% in Chapter Tests"
<< "\n\t" << exam << "% in Final Exam"
<< "\n\t" << partic << "% in Class Participation" << endl;
displayResults(finalGrade);
return 0;
}
//*****************************************************************************************************
void readGrades(float &assign, float &test, float &exam, float &partic) {
cout << "\nWhat is the graded percentage (out of 100%) for Programming Assignments? ";
cin >> assign;
cout << "What is the graded percentage (out of 100%) for Chapter Tests? ";
cin >> test;
cout << "What is the graded percentage (out of 100%) for Final Exam? ";
cin >> exam;
cout << "What is the graded percentage (out of 100%) for Class Participation? ";
cin >> partic;
}
//*****************************************************************************************************
void calcWeights(float &assign, float &test, float &exam, float &partic,
float ASSIGN_PERCENT, float TEST_PERCENT, float EXAM_PERCENT, float PARTIC_PERCENT) {
assign = (assign * ASSIGN_PERCENT) / 100;
test = (test * TEST_PERCENT) / 100;
exam = (exam * EXAM_PERCENT) / 100;
partic = (partic * PARTIC_PERCENT) / 100;
}
//*****************************************************************************************************
float calcFind(float assign, float test, float exam, float partic) {
return (assign + test + exam + partic);
}
//*****************************************************************************************************
void displayResults(float finalGrade) {
cout << "\nFinal Grade: " << finalGrade << "%" << endl;
}
//*****************************************************************************************************
/*
Grade Calculator - Computer Programming I
The weight of each deliverable on their final grade
Programmig Assignments: 15%
Chapter Tests: 50%
Final Exam: 30%
Class Participation: 5%
What is the graded percentage (out of 100%) for Programming Assignments? 100
What is the graded percentage (out of 100%) for Chapter Tests? 100
What is the graded percentage (out of 100%) for Final Exam? 100
What is the graded percentage (out of 100%) for Class Participation? 100
15% in Programming Assignments
50% in Chapter Tests
30% in Final Exam
5% in Class Participation
Final Grade: 100%
//*****************************************************************************************************
Grade Calculator - Computer Programming I
The weight of each deliverable on their final grade
Programmig Assignments: 15%
Chapter Tests: 50%
Final Exam: 30%
Class Participation: 5%
What is the graded percentage (out of 100%) for Programming Assignments? 85
What is the graded percentage (out of 100%) for Chapter Tests? 90
What is the graded percentage (out of 100%) for Final Exam? 95
What is the graded percentage (out of 100%) for Class Participation? 100
12.75% in Programming Assignments
45% in Chapter Tests
28.5% in Final Exam
5% in Class Participation
Final Grade: 91.25%
//*****************************************************************************************************
Grade Calculator - Computer Programming I
The weight of each deliverable on their final grade
Programmig Assignments: 15%
Chapter Tests: 50%
Final Exam: 30%
Class Participation: 5%
What is the graded percentage (out of 100%) for Programming Assignments? 75
What is the graded percentage (out of 100%) for Chapter Tests? 85
What is the graded percentage (out of 100%) for Final Exam? 95
What is the graded percentage (out of 100%) for Class Participation? 90
11.25% in Programming Assignments
42.5% in Chapter Tests
28.5% in Final Exam
4.5% in Class Participation
Final Grade: 86.75%
*/