Hi everyone, Iam really bad at C++, and on my home work (yes i have it completed i just dont understand an error i keep getting) its saying a statement is missing, when obviously its there, its stumping me completely, if i delete the line the error just moves to the next line ive tried diffrent ways of displaying it but for the life of me (or maybe my terrible luck programming) I am lost as to what to do.
please be gentle its not the best but iam trying to learn...
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// data declarations
int numTests = 5; // The number of test scores
// TODO
// declare 5 test score variables (one per line, type int)
// declare 1 test score average variable (type float or double)
int score1;
int score2;
int score3;
int score4;
int score5;
float avg;
// Inputs
// TODO
// Prompt uers & get five test scores (five prompts)
cout << "Please enter test score Number one: ";
cin >> score1;
cout << "Please enter test score Number two: ";
cin >> score2;
cout << "Please enter test score Number three: ";
cin >> score3;
cout << "Please enter test score Number four: ";
cin >> score4;
cout << "Please enter test score Number five: ";
cin >> score5;
// Processing
// TODO
// Calculate the total value of the tests and the average
// Use casting if necessary
avg=score1+score2+score3+score4+score5/numTests
// Output
// TODO
// Display results
// Line 1: the label
// Line 2: the manipulators setprecision, fixed, showpoint
// Line 3: the test score average
LINE I GET ERROR-->>>
cout <<"The average score is: ";
cout << setprecision(3);
cout << avg;
// Program termination
cin.ignore();
cin.get();
return 0;
}