Question
Write the program to calculate the average number of wins for a soccer team over the last three seasons. The number of wins are integer
Write the program to calculate the average number of wins for a soccer team over the last three seasons. The number of wins are integer values. However, the average number of wins is a double value that should be displayed to two decimal places. Notes: Use the following test data: 27, 24, 33 and 27, 24, 29 Display the average number of wins to 2 decimal places. The two decimal places should display even if the value of the average is a whole number (see screen shot below). Line up all three input prompts exactly 5 spaces over (do NOT use the \t escape sequence, use setw). The number of seasons to test is always exactly 3. As such, this must be a constant value. EXTRA CREDIT: The number of games won MUST be greater than or equal to zero. For extra credit, test each entry to assure that a valid value is entered. If the value entered is invalid, display an error message and allow the user to reenter the value immediately. The validation MUST be immediate. Do not enter in all three values and then validate.
The output must match these two pictures below.
Please solve correctly, using Visual Studio C++
Coding should be done using Visual Studio C++ .
Thank you.
nput Data: Enter number of wins in season 1:27 Enter number of wins in season 2:24 Enter number of wins in season 3:29 he average number of wins per year is: 26.67 ress any key to continue . . . Input Data: Enternumberofwinsinseason1:3 Error - You cannot enter in a value less than 0 . Please reenter here: 27 Enter number of wins in season 2:24 Enter number of wins in season 3:26 The average number of wins per year is: 25.67 Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started