Question: You have to find all syntactical errors in the given code by writing the line number where you found the error, what the error is
You have to find all syntactical errors in the given code by writing the line number where you found the error, what the error is and your correction. At least errors.
initialize totalscore and count to b
F This program will first get all test scores of a student.
Then calculate its average.
#include iostream
use namespace std;
Int main
int score; totalscore, count;
int averagescore; we only want the integer part of average score
initialize totalscore and count to be zero
total score ;
count
get all input scores
cout "Enter scores. Enter a negative value to stop: ;
do
cin score;
if score
total score t scone: add the score to total scoree zero
total score ;
coun't
get all input scores
cout "Enter scores. Enter a negative value to stop: ;
do
cin score;
if score
totalscore score; add the score to total score
count ; increase score count by
while score
calculate average
if count
average totalscore count;
cout "Your average score is: averagescore endl;
else;
cout "You have no score entered.n;
systempause;
return ;
G This program will first get all test scores of a student.
Then calculate its average.
#include iostream
use namespace std;
Int main
int score; totalscore, count;
int averagescore; we only want the integer part of average score
initialize totalscore and count to be zero
total score ;
count
get all input scores
cout "Enter scores. Enter a negative value to stop: ;
do
cin & score;
initialize totalscore and count to be zero
total score ;
coun't
get all input scores
cout "Enter scores. Enter a negative value to stop: ;
do
cin ll score;
if score
totalscore score; add the score to total score
count ; increase score count by
while score
calculate average
if count
average totalscore count;
cout "Your average score is: averagescore endl;
else;
cout "You have no score entered.n;
systempause;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
