Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* AnRan Lee (Aaron)
- CIS 71A - CIS 22A Winter 2018
- Laboratory Assignment D
- Problem D1
- This program finds momentum and kinetic energy with a mass and velocity.
- */
- #include <iostream>
- using namespace std;
- int main()
- {
- double testscoreA, testscoreB, testscoreC;
- double averagescore, homeworkdone, homeworktotal, homeworkaverage;
- cout << "Enter 3 test scores" << endl;
- cin >> testscoreA >> testscoreB >> testscoreC;
- averagescore= (testscoreA + testscoreB + testscoreC)/3;
- if(averagescore>90.0){
- cout << "Your grade is A." <<endl;}
- if(averagescore>80.0 && averagescore<90.0){
- cout << "Your grade is B." << endl;}
- if(averagescore>70.0 && averagescore<80.0){
- cout << "Your grade is C." << endl;}
- if(averagescore>60.0 && averagescore<70.0){
- cout << "Enter the number of assignments you turned in: " << endl;
- cin >> homeworkdone;
- cout << "Enter the total number of assignments: " << endl;
- cin >> homeworktotal;
- homeworkaverage=homeworkdone/homeworktotal;
- if(homeworkaverage>80.0){
- cout << "Your grade is D." << endl;}
- if(homeworkaverage<80.0){
- cout << "Your grade is F." << endl;}
- }
- if(averagescore<60.0){
- cout << "Your grade is F." << endl;}
- return 0;
- }
- /* Execution Results:
- Enter 3 test scores
- 96
- 84
- 90
- Your grade is A.
- Process returned 0 (0x0) execution time : 11.854 s
- Press any key to continue.
- Enter 3 test scores
- 95
- 83
- 90
- Your grade is B.
- Enter 3 test scores
- 73
- 58
- 65
- Enter the number of assignments you turned in:
- 8
- Enter the total number of assignments:
- 11
- Your grade is F.
- Process returned 0 (0x0) execution time : 12.502 s
- Press any key to continue.
- Process returned 0 (0x0) execution time : 5.715 s
- Press any key to continue.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement