Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91981333
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Programming Language

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As