#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
#include%26lt;iomanip%26gt;
using namespace std;
void main ()
{
string firstName, lastName;
float num1 = 0.0;
float num2 = 0.0;
float num3 = 0.0;
float num4 = 0.0;
float num5 = 0.0;
cout%26lt;%26lt;"Please enter your first and last name: ";
cin%26gt;%26gt;firstName, lastName;
cout%26lt;%26lt;"Please enter the student's five program scores";
cout%26lt;%26lt;"Each score must be an integer between 0 %26amp; 100";
cout%26lt;%26lt;"Please enter your first program score: ";
cin%26gt;%26gt;num1;
cout%26lt;%26lt;"Please enter your second program score: ";
cin%26gt;%26gt;num2;
cout%26lt;%26lt;"Please enter your third program score: ";
cin%26gt;%26gt;num3;
cout%26lt;%26lt;"Please enter your fourth program score: ";
cin%26gt;%26gt;num4;
cout%26lt;%26lt;"Please enter your fifth program score: ";
cin%26gt;%26gt;num5;
cout%26lt;%26lt;"Program scores you entered were: "%26lt;%26lt;setw(5)%26lt;%26lt;num1%26lt;%26lt;setw(5)%26lt;%26lt;num2%26lt;%26lt;setw(5)...
programAverage = (num1+num2+num3+num4+num5)/5;
What am i typing wrong in this C++ program?
You never declared variable programAverage.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment