/*02/04/08 Programming Fundamentals II Homework Assignment Chapter 3-Question #3.6 Test Average - Write a program that asks for five test scores. The program should calculate the average test score and display it. The number displayed should be formatted in fixed-point notation, with one decimal point of precision. */ #include //needed for cout and cin (input and output) #include //needed to use stream manipulators using namespace std; //provides access to std namespace int main()//beginning of main function {//beginning of the function main double test1, test2, test3, test4, test5, average;//creates double variables cout << "Welcome to Test Score Average.\n";//welcomes user cout << "Please enter your 1st test score.\n";//asks user for 1st test score cin >> test1;//saves test score 1 cout << "Please enter your 2nd test score.\n";//asks user for 2nd test score cin >> test2;//saves test score 2 cout << "Please enter your 3rd test score.\n";//asks user for 3rd test score cin >> test3;//saves test score 3 cout << "Please enter your 4th test score.\n";//asks user for 4th test score cin >> test4;//saves test score 4 cout << "Please enter your 5th test score.\n";//asks user for 5th test score cin >> test5;//saves test score 5 average = (test1 + test2 + test3 + test4 + test5)/5;//adds 5 scores & divides by 5 cout << "Your average test score is " << fixed << setprecision(1) << average << endl; //tells user average score with setprecision of 1, so one number right of decimal return 0;//returns int of 0 for main() to end program }//end of the function main