Woops, forgot the code.

  • From: Jes <theeternalkid@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Wed, 7 Jul 2010 04:08:40 -0400

Here's the code.
//Ch5 Exercise 4, page 287 //Calculates and displays the average of three test 
//created/revised by Jes Smith on July 5 2010

#include <iostream>
using namespace std;
 //begin program
int main()
//declare variables
double score_1=0;
double score_2=0;
double score_3 (0);
int answer;
cout<< "This program takes three test score numbers you enter, and figures out 
the average for you. ";
                                        cout<< "Please enter your first test 
score, then press enter. Decimal values accepted: " ;
cin >> score_1 ;
cout<< "Please enter your second  test score. Remember to press enter when 
done: ";
cin >>score_2  ;
                cout<< "Finally, enter your third   test score.";
cin >>score_3  ;
 answer = score_1+score_2+score_3/3;
 cout<<"The average is " <<answer;

return (0);
} //end of main function.

Other related posts: