// cs101,TTH
// calculate my average
// This program will calculate my curent grade average
#include <iostream.h>
const int NUMSCORES = 3;
int main()
{
int Firstscore; //holds first score
int secondscore; //holds second score
int thirdscore; //holds third score
int totals_scores ; //holds input values of total scores
cout << "NUMSCORES=3\n";
cout << "\t Grade Averages Calculator\n"; //output a title
cout << "\n"; //output blank line
cout << "Enter firstscore (whole number between 0 and 100)\n";
cin >> " total_scores=(firstscore + secondscore + thirdscore)/3";
cout << "Enter secondscore (whole number between 0 and 100)\n";
cin >>" total_scores=(firstscore + secondscore + thirdscore)/3";
"myprog.C" 29 lines, 970 characters
chicoma [48]-% CC myprog.C
cc-1020 CC: ERROR File = myprog.C, Line = 27
The identifier "total_scores" is undefined.
cout << total_scores <<" thirdscore << secondscore << firstscore\n";
^
cc-1174 CC: WARNING File = myprog.C, Line = 12
The variable "Firstscore" was declared but never referenced.
int Firstscore; //holds first score
^
cc-1174 CC: WARNING File = myprog.C, Line = 13
The variable "secondscore" was declared but never referenced.
int secondscore; //holds second score
^
cc-1174 CC: WARNING File = myprog.C, Line = 14
The variable "thirdscore" was declared but never referenced.
int thirdscore; //holds third score
^
cc-1174 CC: WARNING File = myprog.C, Line = 15
The variable "totals_scores" was declared but never referenced.
int totals_scores ; //holds input values of total scores
^
cc-1174 CC: WARNING File = myprog.C, Line = 8
The variable "NUMSCORES" was declared but never referenced.
const int NUMSCORES = 3;
^
1 error detected in the compilation of "myprog.C".
chicoma [49]-%
chicoma [49]-%

Help

Back to top









