diff options
| author | [email protected] <[email protected]> | 2021-10-19 23:29:47 -0700 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2021-10-19 23:29:47 -0700 |
| commit | dece0536d375ad7155f0c7c9596e7b8a5de49022 (patch) | |
| tree | f7a783e78fe631d89f6441361f25610e51a88e01 /CST116F2021-Lab3/LAB3Answers-Ansari.txt | |
| parent | lab 3 answers (diff) | |
| download | archived-cst116-lab3-rayyanansari03-master.tar.xz archived-cst116-lab3-rayyanansari03-master.zip | |
Diffstat (limited to 'CST116F2021-Lab3/LAB3Answers-Ansari.txt')
| -rw-r--r-- | CST116F2021-Lab3/LAB3Answers-Ansari.txt | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/CST116F2021-Lab3/LAB3Answers-Ansari.txt b/CST116F2021-Lab3/LAB3Answers-Ansari.txt index 806f79f..ec0b9e2 100644 --- a/CST116F2021-Lab3/LAB3Answers-Ansari.txt +++ b/CST116F2021-Lab3/LAB3Answers-Ansari.txt @@ -515,40 +515,44 @@ int main() if (numAssignments > 0) { for (int i = 0; i < numAssignments; i++) { + cout << "Please enter assignment score: "; cin >> Assignment; avgNum += Assignment; - + } cout << endl; + cout << "The average of the assignments is: "; cout << (float)avgNum / numAssignments; - + } else { - + cout << "Insufficient number of assignments"; - + } - - + + } + OUTPUT: Please enter the number of assignments in the class: 5 -1 -1 -2 -3 -4 - -2.2 -C:\Users\ansar\source\repos\Lab3-Ansari\Debug\Lab3-Ansari.exe (process 5884) exited with code 0. +Please enter assignment score: 32 +Please enter assignment score: 45 +Please enter assignment score: 67 +Please enter assignment score: 12 +Please enter assignment score: 1 + +The average of the assignments is: 31.4 +C:\Users\ansar\Source\Repos\cst116-lab3-rayyanansari03\Debug\CST116F2021-Lab3.exe (process 11936) 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 . . . + ------------------------------------------------- EXERCISE 6c |