-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalc.cpp
More file actions
32 lines (20 loc) · 694 Bytes
/
calc.cpp
File metadata and controls
32 lines (20 loc) · 694 Bytes
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
#include <iostream>
using namespace std;
int main() {
cout << "Please input your current grade: ";
double cur_grade;
cin >> cur_grade;
cout << endl;
cout << "Please input passing grade: ";
double pass_grade;
cin >> pass_grade;
cout << endl;
cout << "Please input the worth of the final as a percentage: ";
double per_grade;
cin >> per_grade;
cout << endl;
//Required = (Goal − Current × (100% − Final Weight)) / Final Weight
double end_all = (100*pass_grade-(100-per_grade)*cur_grade)/per_grade;
cout << "You need to make a " << end_all << " on your final to pass the class with a " << pass_grade << endl;
return 0;
}