Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[I WILL SUBMIT A GOOD REVIEW IF EVERYTHING BELOW IS PROPERLY FORMATTED AND EVERY INDICATION THAT IS MADE IS FOLLOWED] Thank you. CSCI 161 -

[I WILL SUBMIT A GOOD REVIEW IF EVERYTHING BELOW IS PROPERLY FORMATTED AND EVERY INDICATION THAT IS MADE IS FOLLOWED] Thank you.

CSCI 161 - Lab #6: Dives

Objectives

Write a program that calculates the score of a professional diver. Your program will read all of its data from a file. Each line of the file has the data for one scored dive. Each line of dive data has a dive number and a degree of difficulty factor along with the individual dive scores from seven (7) judges that each score the dive by assigning a real number between 0 and 10 (inclusive). Your program will total the scores for each dive, omitting the highest and lowest scores, then multiply this sum by a degree of difficulty (a real number between 1 and 4, inclusive), and lastly multiply that result by 0.6 to achieve a total score for a given dive. Each diver might perform multiple dives. Your program will also calculate the overall score for a diver by averaging the scores of the individual dives.

Instructions

Following are the instructions and you should follow them carefully:

Using Eclipse create a new Java Project and name it: Lab6

As with all your labs and assignments, add a class of the same name, Lab6 , and include in that class a main method.

Your program must read a file according to the "Input Specification" below.

Your program must employ, among possible others, the methods described in the Required Methods section below.

Your program must output according to the "Output Specification" below.

Iteratively develop the assignment (get the original version working, test it, add code to one method, test, fix if needed, continue).

When the assignment is complete and working submit it as Lab6

Required Methods

Following are a list of methods to use and/or write:

 // For detecting the high and low scores (use these, Google for their usage) Math.max Math.min // Print the introductory message (write this) void printIntro() // Read each line from input file and output scores and average (write this) void processDives(Scanner fileScanner) // Calculate the score for one dive (write this) // Do *not* print any results in this method double calculateDiveScore(String diveLine) 

Input Specification

Your program must read from the file "DiveData.txt" (spelled exactly as shown) and that file should be in the current working directory. You can assume the input file contains data for at least one dive, the dives are listed in order, and the file does NOT contain errors.

Each line will be formatted as follows:

     ...  

The dives will ALWAYS be listed in order (1, 2, 3, etc.).

For example, the following lines contain data for two dives:

 1 3.5 5.5 6.0 7.0 6.5 6.5 5.5 7.5 2 2.0 8.0 8.5 8.5 9.0 8.0 8.5 8.0 

Feel free to test with the lines above in your "DiveData.txt" file, or feel free to use any other data that conforms precisely to the file format described above.

Output Specification

Output an introductory message and then the scores for each dive.

Your program should output precisely according to the format below (wording, spacing, punctuation, precision of doubles, etc).

 Welcome to the Diver Scoring program. This program will calculate an overall score for a diver, based on individual dives. The diver's score for dive 1 is 66.15. The diver's score for dive 2 is 49.80. The average score for these dives is 57.97. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago