Givetheuserspecificinstructionsforwhattheiranswershouldbe


Computer Science

Program-

Write all of the following:

main program:

Call a function to open an input file.
Call a function to read 3 integers in from the input file.
Call a function that will find 3 normalized doubles, given the 3 integer inputs.
Call a function to write out the 3 integers and the three doubles to an output file.
Call a function that will ask the user if they want to continue.
Repeat all of the following steps if the user chooses to continue.

openFile function:

Ask the user for the name of an input file.

Try to open this file. If the file is not found, ask for another name and try again. Repeat until an input file is successfully opened.
Send back a reference to the open file

getData function:

Given the open input file, read in 3 integer values and send them all back to the main program.

largest function:

Given 3 integer values, find the largest one, and send that one value back.

normalize function:

Given 3 integer values, call largest function to find which is biggest.

Divide each of the 3 integer values by the largest, resulting in 3 double values (i.e. inputs of 2, 3, 4 will give normalized values of 0.5, 0.75, 1.0).

Send back the 3 normalized double values.

output function:

Given: 3 integers and 3 doubles
Ask the user for the name of an output file
Open the output file for writing
Write out the 6 numerical values with some explanatory text
Close the output file

getOption function:

Ask the user if they want to continue.
Give the user specific instructions for what their answer should be (i.e. Y or N). If their answer is anything other than one of the specified choices, write an error message and repeat the input until a desired answer is found. (ex. If you ask for 0 or 1, then repeat until the user enters 0 or 1).

Send back the user's choice

The usual comments are required, plus write a description of each function's purpose before its definition. Submit printout and on Titanium.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Givetheuserspecificinstructionsforwhattheiranswershouldbe
Reference No:- TGS01609072

Now Priced at $50 (50% Discount)

Recommended (90%)

Rated (4.3/5)