Part 1: Code a solution from the problem statement Gymnastics Competition A Gymnastics competition uses one of two methods for calculating the gymnast’s score. The competition utilizes either three judges or five judges. Write a program to ask which scoring method is utilized and how many competitors are in the competition. Then input the scores from the judges, and calculate the average score for a contestant. Use the following algorithm as a guide.   Algorithm Display a welcome message to the user. Be creative. Name your competition. Make the message user-friendly and display it in a pleasing manner. Display a menu to the user with options for three judges, five judges or quit. If a user enters an option that is not on the menu, display a user-friendly error message and allow the user to try again. Use a string constant for the error message. If the competition utilizes three judges, ask how many gymnasts are in the competition. Validate that the number is between 1 and 20. For each gymnast, ask the user to input the contestant’s full name and the three scores. A score must be between 0 and 10 and fractional scores such as 6.5 are allowed. If a user inputs an invalid score, present a user-friendly error message and allow the user to try again. A contestant’s final score is determined by calculating an average of the three scores. Use a constant string for the error message. Display the contestant’s name and average score in a user-friendly format. If there are five judges, ask how many gymnasts are in the competition. Validate that the number is between 1 and 50. For each gymnast, ask the user to input the contestant’s full name and input the five scores. A score must be between 0 and 10 and fractional scores such as 6.5 are allowed. If a user inputs an invalid number, present a user-friendly error message and allow the user to try again. A contestant’s final score is determined by dropping the highest score and lowest score, then averaging the three remaining scores. Use a constant string for the error message. You determine three different messages to give the gymnast based on their score in three categories. If the average score is between zero and 5.0, display message 1. Use a string constant for message 1. If the average score is greater than 5.0 and less than 8.0, display message 2. Use a string constant for message 2. If the average score is greater than or equal to 8.0, display message 3. Use a string constant for message 3. Display the contestant’s full name, average score, and message in a user-friendly format. End the program when the user chooses the Quit option from the menu. Note: Only use the skills learned so far in the class. No arrays. No functions. No structs. Save your file as LastName_FirstName_Midterm.cpp and submit to Canvas.   Part 2: Submit a walk-through of your code.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Part 1: Code a solution from the problem statement

Gymnastics Competition

A Gymnastics competition uses one of two methods for calculating the gymnast’s score. The competition utilizes either three judges or five judges. Write a program to ask which scoring method is utilized and how many competitors are in the competition. Then input the scores from the judges, and calculate the average score for a contestant. Use the following algorithm as a guide.

 

Algorithm

  • Display a welcome message to the user. Be creative. Name your competition. Make the message user-friendly and display it in a pleasing manner.
  • Display a menu to the user with options for three judges, five judges or quit. If a user enters an option that is not on the menu, display a user-friendly error message and allow the user to try again. Use a string constant for the error message.
  • If the competition utilizes three judges, ask how many gymnasts are in the competition. Validate that the number is between 1 and 20. For each gymnast, ask the user to input the contestant’s full name and the three scores. A score must be between 0 and 10 and fractional scores such as 6.5 are allowed. If a user inputs an invalid score, present a user-friendly error message and allow the user to try again. A contestant’s final score is determined by calculating an average of the three scores. Use a constant string for the error message. Display the contestant’s name and average score in a user-friendly format.
  • If there are five judges, ask how many gymnasts are in the competition. Validate that the number is between 1 and 50. For each gymnast, ask the user to input the contestant’s full name and input the five scores. A score must be between 0 and 10 and fractional scores such as 6.5 are allowed. If a user inputs an invalid number, present a user-friendly error message and allow the user to try again. A contestant’s final score is determined by dropping the highest score and lowest score, then averaging the three remaining scores. Use a constant string for the error message.
    • You determine three different messages to give the gymnast based on their score in three categories.
      • If the average score is between zero and 5.0, display message 1. Use a string constant for message 1.
      • If the average score is greater than 5.0 and less than 8.0, display message 2. Use a string constant for message 2.
      • If the average score is greater than or equal to 8.0, display message 3. Use a string constant for message 3.
    • Display the contestant’s full name, average score, and message in a user-friendly format.
  • End the program when the user chooses the Quit option from the menu.

Note: Only use the skills learned so far in the class. No arrays. No functions. No structs.

Save your file as LastName_FirstName_Midterm.cpp and submit to Canvas.

 

Part 2: Submit a walk-through of your code.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education