Question

#include <iostream> uisng  namespace std; int main() {             cout<<"Enter your three test scores and I...



#include <iostream>

uisng  namespace std;


int main()


{

            cout<<"Enter your three test scores and I will ";

                 <<" average them: ";


            int score1, score2, score3,


            cin>>score1>>score2>>score3;


            double average;


            average = (score1 + score2 + score3) / 3.0;


            if (average = 100);

                        perfectScore = true; // set the flag variable

            cout<<"Your average is "<<average <<endl;


            bool perfectScore;


            if (perfectScore);


            {


                        cout<<"Congratulations!\n";

                        cout<<"That's a perfect score.\n";

                        return 0;


            }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:-

// NOTE : I fixed all the error

#include <iostream>

using namespace std;
int main()
{
   bool perfectScore=false;
cout<<"Enter your three test scores and I will average them: ";
int score1, score2, score3;
cin>>score1>>score2>>score3;
double average;
average = (score1 + score2 + score3) / 3.0;
if (average == 100)
perfectScore = true; // set the flag variable
cout<<"Your average is "<<average <<endl;
if (perfectScore)
{
cout<<"Congratulations!\n";
cout<<"That's a perfect score.\n";
return 0;
}
}

OUTPUT:-

// If any doubt please comment

Add a comment
Know the answer?
Add Answer to:
#include <iostream> uisng  namespace std; int main() {             cout<<"Enter your three test scores and I...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT