Advertisement
axyd

CS172 l2ex03

Feb 18th, 2016
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5.     double dblex03(){
  6.         double T1, T2, T3, T4, T5, Avg;
  7.         cout << "\n####Lab 2, Exercise 3####\n";
  8.         cout << "Calculator: Test Average (5 tests)\n\n";
  9.  
  10.         cout << "Input Test 1 Score: \n";
  11.         cin >> T1;
  12.         cout << "Input Test 2 Score: \n";
  13.         cin >> T2;
  14.         cout << "Input Test 3 Score: \n";
  15.         cin >> T3;
  16.         cout << "Input Test 4 Score: \n";
  17.         cin >> T4;
  18.         cout << "Input Test 5 Score: \n";
  19.         cin >> T5;
  20.         Avg = (T1 + T2 + T3 + T4 + T5) / 5;
  21.         cout << "Your Average Score is: " << setprecision(1) << fixed << Avg << endl << endl;
  22.  
  23.         return 0;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement