Cis 170 ilab 3 of 7

  • 80 views
Uploaded on


Part A: Requirements - DIVE Scoring Program
Your mission: The state diving commission wants to computerize the scoring at its diving competitions.
You’ve been hired to write a program to automate the scoring of dives. Following are the requirements for the program.
After each dive, the user will be prompted to enter the:
diver’s name;
diver’s city;
degree of difficulty (ranges from 1.00 to 1.67); and
scores from five judges (scores can range from 0 to 10).
If an invalid score is entered, an error message will be displayed. The user will be prompted for the score repeatedly until a valid score is entered.
The program will then display the following information:
Diver’s name
Diver’s city

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
80
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CIS/170 - iLab 3 of 7CLICK HERE TO GET THE SOLUTION !!!!!!!Part A: Requirements - DIVE Scoring ProgramYour mission: The state diving commission wants to computerize the scoring at its diving competitions.You’ve been hired to write a program to automate the scoring of dives. Following are the requirements forthe program.After each dive, the user will be prompted to enter the: diver’s name; diver’s city; degree of difficulty (ranges from 1.00 to 1.67); and scores from five judges (scores can range from 0 to 10).If an invalid score is entered, an error message will be displayed. The user will be prompted for the scorerepeatedly until a valid score is entered.The program will then display the following information: Diver’s name Diver’s city Dive final score: This is calculated by dropping the highest and lowest of the five judges’ scores. Theremaining three scores are added together, and the result is divided by 3 and then multiplied by thedegree of difficulty.The program will then prompt the user if she/he wants to process another dive. The user can type “Y” or“y” to continue, and ”N” or “n” to quit.Sample output:Diver’s name: Sue JonesDiver’s city: DallasDive degree of difficulty: 1.9Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)Dive degree of difficulty: 2Invalid degree of difficulty – Please reenter (Valid Range: 1 – 1.67)Dive degree of difficulty: 1.2Judge #1 score: 45Invalid score – Please reenter (Valid Range: 0 – 10)Judge #1 score: 3Judge #2 score: 4.5Judge #3 score 6.7Judge #4 score 89Invalid score – Please reenter (Valid Range: 0 – 10)Judge #4 score 8Judge #5 score: 9.2
  • 2. Diver: Sue JonesCity: DallasDive score: 7.68Do you want to process another dive (Y/N)? yDiver’s name: Dave SmithDiver’s city: HoustonDive degree of difficulty: 1.1Judge #1 score: 5.7Judge #2 score: 6.8Judge #3 score:: 7.6Judge #4 score: 8.7Judge #5 score: 6.7Diver: Dave SmithCity: HoustonDive score: 7.74Do you want to process another diver (Y/N)? NTipsPseudocode: Although there are several valid ways to write the program, the following is an outline ofone way to design the overall logic.Declare and initialize variables: name, city, judge score, highest score, lowest score, total scoreLoop while there are dives to process Get diver’s name and city Get degree of difficulty Loop to validate input End LoopLoop five times to get judges’ scores Loop to Validate input End Loop Update highest and lowest scores if need be Add score to total scoreEnd Loop Calculate the final score (subtract highest and lowest scores from total score, divide by3, multiply by degree of difficulty) Display the diver’s information and final dive score Prompt the user ifhe or she wants to process another dive End-LoopScreenshot 1CLICK HERE TO GET THE SOLUTION !!!!!!!