Saturday, May 22, 2010

Can someone help me with my C++ program please!?

i get an error that says: Error C2065: 'test1' : undeclared


test1 has been declare - what is the problem? this is my code:


#include%26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using std::cout;


using std::cin;


using std::endl;


using std::setprecision;


using std::fixed;





//fucntion prototype


void getTestScores(double%26amp;, double%26amp;, double%26amp;);


double calcAverage(double, double, double);


void displayAverage(double);





int main ()


{


//decalare variables


double test1 = 0.0;


double test2 = 0.0;


double test3 = 0.0;


double average = 0.0;


double getAverage = 0.0;





//enter functions to het input items


getTestScores(test1, test2, test3);


getAverage = calcAverage(test1, test2, test3);


displayAverage(average);





return 0;


} //end of main function





//**program defined functions ****


void getTestScores(double %26amp;test1, double %26amp;test2, double %26amp;test3)


{


cout %26lt;%26lt; "Enter the first score: ";


cin %26gt;%26gt; testl;


cout %26lt;%26lt; "Enter the second score: " ;


cin %26gt;%26gt; test2;

Can someone help me with my C++ program please!?
No, the previous answerer is correct in line 36, you're using an L instead of a 1.
Reply:You wrote


testl


where you should have written


test1





The compiler does not lie even if lower case L looks the same as 1.


No comments:

Post a Comment