Question

Programming: Chapter 3 Write a a program that asks the user to enter a golfers score for three games of golf, and then displays the average of the three scores.
0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>
#include <iomanip>

using namespace std;

int main() {
   double temp, sum = 0;
   cout<<"Enter 3 scores: "<<endl;
   for(int i = 0;i<3;i++){
      cin>>temp;
      sum += temp;
   }
   cout<<"Average = "<<(sum/3)<<endl;
}

Enter 3 scores: 30 40 50 Average40 Process exited after 2.439 seconds with returnvalue 0 Press any key to continue . - .

\color{blue}Please\; up\;vote\;the \;solution \;if \;it \;helped.\;Thanks!

\color{red}Note: \;Please \;comment \;below \;if \;you \;have \;any \;issues \;with \;this \;solution.\;

Add a comment
Know the answer?
Add Answer to:
Programming: Chapter 3 Write a a program that asks the user to enter a golfer's score...
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
ADVERTISEMENT