Write a program that reads and processes data

Assignment Help Programming Languages
Reference no: EM131324994

Program 1

Write a program that reads and processes data about quarterly rainfall for one year. Your program should ask the user to enter rain fall amounts for each of the four quarters in the year. You must use a looping construct to read the input for one quarter at a time until all four quarters' data has been read. The program should output the name which quarter (i.e. Quarter 1, Quarter 2, Quarter 3, or Quarter 4) had the most rainfall, which quarter had the least rainfall, the average rainfall for the entire year, and the total rainfall for the entire year. All output should be displayed with meaningful descriptions.

Program 2

Modify program 1 so that it will handle multiple years of rainfall data. The user should be asked at runtime to supply the actual number of years they want to enter in the program for evaluation. In addition to the output specified in program 1 for each individual year, program 2 should output the year (i.e. Year 1, Year 2, etc.) with the most total rainfall and the year with the least total rainfall. All output should be displayed with meaningful descriptions. You are required to use a nested looping construct for this program.

Sample output: (Your program should work properly with all positive data)

How many year's rainfall amounts would you like to enter: 2

ÏÏ ÏEnter data for year 1

Ï Enter the rainfall for quarter 1: 4

Ï Enter the rainfall for quarter 2: 2

Ï Enter the rainfall for quarter 3: 8

Ï Enter the rainfall for quarter 4: 6

ÏÏÏ

ÏÏ Ï Quarter 3 had the most rainfall with 8.0 inches

ÏÏ Ï Quarter 2 had the least rainfall with 2.0 inches

ÏÏ Ï The total rainfall for year 1 was 20.0 inches

ÏÏ Ï The average quarterly rainfall for year 1 was 5.0 inches

ÏÏ Ï

ÏÏ ÏEnter data for year 2

Ï Enter the rainfall for quarter 1: 3.1

Ï Enter the rainfall for quarter 2: 9.1

Ï Enter the rainfall for quarter 3: 5.1

Ï Enter the rainfall for quarter 4: 1.1

ÏÏÏ

ÏÏ Ï Quarter 2 had the most rainfall with 9.1 inches

ÏÏ Ï Quarter 4 had the least rainfall with 1.1 inches

ÏÏ Ï The total rainfall for year 2 was 18.4 inches

ÏÏ Ï The average quarterly rainfall for year 2 was 4.6 inches

ÏÏÏ

Ï ÏYear 1 had the most rainfall with 20.0 inches

ÏÏ ÏYear 2 had the least rainfall with 18.4 inches(hint - This program will require nested loops. The outer loop determines the year and the inner loop determines the quarter within the year. If you are having trouble understanding nested loops be sure to watch the screen cast on nested loops, it is based on an application very similar to this problem.)

Reference no: EM131324994

Questions Cloud

Differentiate a seizure from epilepsy : Define a seizure. Differentiate a seizure from epilepsy. Which area of the brain is involved in seizures? How do certain neurotransmitters play a role in some seizures?
Rate of return on investments of this risk : A company just paid an annual dividend of $0.82 per share, and this dividend is expected to remain constant in the future. What is one share worth today if you require a 12% rate of return on investments of this risk?
Domain of membrane protein : How to define which domain of membrane protein is intracellular or extracellular domain?
Compute bowen''s accounting profits : If Bowen worked for another farmer or a local manufacturer, his annual income would be about $30,000. Bowen can invest any funds that would be derived, if the farm were sold, to earn 10 percent annually. (Ignore taxes.)
Write a program that reads and processes data : Write a program that reads and processes data about quarterly rainfall for one year. Your program should ask the user to enter rain fall amounts for each of the four quarters in the year.
What is the taxable-equivalent yield for an individual : A company has just paid a quarterly dividend of $1.50 per share, which is expected to increase 1% every quarter into the future. The future dividends are an example of which type of cash flow stream? A municipal bond yields 5.1 percent. What is the t..
Determine the (pre-tax) economic profit for this venture : Which of the costs for this firm are explicit and which are implicit?
Future of accounting information systems : After spending the last seven weeks learning about AIS, you have now learned a lot. Now, after reading the article from IBM on "what we know now", highlight the future of accounting information system
Explain the specific information that you would communicate : CIS107-Describe one strategy that you would use to ease the identified concerns of the group, and explain the specific information that you would communicate to them to achieve this goal.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to execute on cse unix environment

Your program should be written in C++, execute correctly on CSE unix environment, and compile using g++ compiler using makefile.

  Neeed to prepare an cgi script that send mass emails

Neeed to prepare an CGI Script that send mass emails - Input fields Sender Name: Sender Email: Subject: Message: choose, by default HTML Emails and send button the script should print the progress of sending.

  Write a program that reads in a number from the user

Write a program that reads in a number from the user and then displays the Hailstone sequence for that number, followed by a line showing the number of steps taken to reach 1.

  Create a client arraylist to process input records in main

Create a Client ArrayList to process input records in main(). Use a for loop to read in the information from client.txt. Create a class called Client, the Client class must contain attributes for Client name.

  Write program to open file for reading

Write the program to open file for reading which has twenty (20) rows and in each row there are three (3) columns. After reading each row call user-defined function to display each row.

  Write a program that receive the values of three boolean

Write a program that receive the values of three boolean varibles,a,b,and c,from standard input and determines if the value of the condition !(xx || xx) &&xx

  Create classes essential to create service quote

Create classes essential to create service quote. Write the application program which will use classes to create the objects and output the service quote.

  Create application which gets customer account data

Some interest Credit Company gives loans to customers at 1.5 percent interest per month. Create the application which gets customer account data which includes the account number, customer name, and balance due.

  Java api represented associative array

Character strings in C and C++ are implemented as arrays of char and Java API represented associative array?

  Creating form which analyzes poker hand entered by user

To observe behavior of Sub Procedures, draw a Form which analyzes a poker hand entered by user and displays the type of hand.

  Create application that uses two-dimensional arrays

Create the application that uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes. You require to ask user to enter grade for each of 5 students.

  Design program that accept number below one hundred as input

Design a program that accepts a number below 100 as input. Once your program has received this number as input, your program should pass this number between a group of 5 friends.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd