Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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.)

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92079592
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

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 ...

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 - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

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 ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

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 ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

  • 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