//OrinTill Qimid CS1A Chapter 3, P. 143, #3
//
/**************************************************************
*
* Calculate average.
* ____________________________________________________________
* This program is going to calcuate the average of 5 given test scores.
* ____________________________________________________________
* INPUT
* test1 : the score of test 1
* test2 : the score of test 2
* test3 : the score of test 3
* test4 : the score of test 4
* test5 : the score of test 5
* OUTPUT
* Total : The calculated average base on the 5 test
*
**************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main( )
{
float test1, //Declearing the 5 test score and the total.
test2,
test3,
test4,
test5,
total;
cout << "What is your score on test 1." << endl;
cin >> test1;
cout << "What is your score on test 2." << endl;
cin >> test2;
cout << "What is your score on test 3." << endl;
cin >> test3;
cout << "What is your score on test 4." << endl;
cin >> test4;
cout << "What is your score on test 5." << endl;
cin >> test5;
total = ( test1 + test2 + test3 + test4 + test5) / 5 ;
cout << "Your average test score is going to be " << total << endl;
return 0 ;
}
Ly9PcmluVGlsbCBRaW1pZCBDUzFBIENoYXB0ZXIgMywgUC4gMTQzLCAjMwovLwovKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICoKICogQ2FsY3VsYXRlIGF2ZXJhZ2UuCiAqIF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwogKiBUaGlzIHByb2dyYW0gaXMgZ29pbmcgdG8gY2FsY3VhdGUgdGhlIGF2ZXJhZ2Ugb2YgNSBnaXZlbiB0ZXN0IHNjb3Jlcy4KICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiAqIElOUFVUCiAqIHRlc3QxIDogdGhlIHNjb3JlIG9mIHRlc3QgMSAKICogdGVzdDIgOiB0aGUgc2NvcmUgb2YgdGVzdCAyCiAqIHRlc3QzIDogdGhlIHNjb3JlIG9mIHRlc3QgMwogKiB0ZXN0NCA6IHRoZSBzY29yZSBvZiB0ZXN0IDQKIC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