Write a program reads in locations followed by 12 lines of numbers that represent amount of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program reads in locations followed by 12 lines of numbers that represent amount of rainfill for each month in that location. The program keeps reading until it encounters end-of-file. It must work for any number of locations. Do not assume that you know how many locations there are. Produce a nicely formatted report that shows the location, the month and rainfall for the month for all twelve months. Then display the total rainfall, the average rainfall per month the month and amount of greatest rainfall in that month. You are given a program shell that contains the function prototypes that you will implement. You must implement these functions. You may change the names of the parameters and the names of the functions but not the parameter lists or the return types of the functions. I am supplying one function that reads rainfall as strings and converts to double The shell also contains the main read-to-end-of-file loop in main. The program reads a data file that I named READRAINFALL.TXT which is also supplied. Submit your source code, and the output file produced by the program. Once the program works, create your own input data file with different locations. Submit the new input file and the output file produced by the program. Be sure that every function has a comment that states its purpose, as well as the normal program heading. Write your own comments. Do not keep old comments that I wrote! Below is output from my program for one location as an example of possible output. Statistics for Hayward Rainfall inches 5.22" Feb 1.50" Mar 3.50" Apr 2.10" May 0.80" Jun 0.00" [I Jul 0.00" Aug 0.00" Sep 0.98" Oct 1.65" Nov 3.18" 3.90" Total for the year 22.83 inches Average rainfall per month 1.90 inches Month with the greatest rainfall was Jan with rainfall of 5.22 inch Month Jan Dec Write a program reads in locations followed by 12 lines of numbers that represent amount of rainfill for each month in that location. The program keeps reading until it encounters end-of-file. It must work for any number of locations. Do not assume that you know how many locations there are. Produce a nicely formatted report that shows the location, the month and rainfall for the month for all twelve months. Then display the total rainfall, the average rainfall per month the month and amount of greatest rainfall in that month. You are given a program shell that contains the function prototypes that you will implement. You must implement these functions. You may change the names of the parameters and the names of the functions but not the parameter lists or the return types of the functions. I am supplying one function that reads rainfall as strings and converts to double The shell also contains the main read-to-end-of-file loop in main. The program reads a data file that I named READRAINFALL.TXT which is also supplied. Submit your source code, and the output file produced by the program. Once the program works, create your own input data file with different locations. Submit the new input file and the output file produced by the program. Be sure that every function has a comment that states its purpose, as well as the normal program heading. Write your own comments. Do not keep old comments that I wrote! Below is output from my program for one location as an example of possible output. Statistics for Hayward Rainfall inches 5.22" Feb 1.50" Mar 3.50" Apr 2.10" May 0.80" Jun 0.00" [I Jul 0.00" Aug 0.00" Sep 0.98" Oct 1.65" Nov 3.18" 3.90" Total for the year 22.83 inches Average rainfall per month 1.90 inches Month with the greatest rainfall was Jan with rainfall of 5.22 inch Month Jan Dec
Expert Answer:
Answer rating: 100% (QA)
Certainly Below is a simple C program that fulfills the requirements youve mentioned This program reads locations and corresponding rainfall data from ... View the full answer
Related Book For
Posted Date:
Students also viewed these computer network questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Listed below are the genders of the younger winner in the categories of Best Actor and Best Actress for recent and consecutive years. Do the genders of the younger winners appear to occur randomly? F...
-
Replace the force and couple-moment system by an equivalent resultant force and couple moment at point O. Express the results in Cartesian vector form. Units Used: kN = 103 N
-
Each of fifteen 60-watt lightbulbs has been randomly placed into an outlet for which the voltage is 3 volts below the line voltage, 2 volts below the line voltage, or equal to the line voltage. The...
-
How does make determine whether a target needs to be rebuilt?
-
Fair Value and Equity Method Compared) Gregory Inc. acquired 20% of the outstanding common stock of Henderson Inc. on December 31, 2010. The purchase price was $1,250,000 for 50,000 shares. Henderson...
-
DATABASE: SQL Data Manipulation Language (DML) : Insert, Update & Delete Statements What are the Command to insert, update and delete data within the database tables please explain? Table Student...
-
Emily Jackson (Social Security number 765-12-4326) and James Stewart (Social Security number 466-74-9932) are partners in a partnership that owns and operates a barber shop. The partnership's first...
-
A client is considering replacing his heating system in an office building. Two systems are being considered. System A has higher initial costs but lower recurring costs. System B has lower initial...
-
What criteria would you use to determine if AI is appropriate for a business? Explain the use of this criteria and use references.
-
Assume that sales for 2020 are $5,600 million. What would capex be for 2020? Format $1234.56 million as 1235 Your Answer:
-
Write a speech for a company to increase its sales and profitability. The speech must be something a company president would present to his/her team.
-
If "The New York Times" went out of business, would it matter? Are smaller online competitors (e.g., Vice, Vox) the future of news?
-
Jack sells land to Jill in 2022 for $75,000 cash plus Jill's note for $225,000. Jack's basis for the property was 120,000. The note will be repaid as follows: $100,000 in 2023 and the balance in...
-
Jake's Sub Shop sells large sub sandwiches for $8.85. Unit variable expenses total $3.95. The break-even sales in units is 5,300 and budgeted sales in units is 9,500. Round answers to the nearest...
-
According to a recent survey, 40% of millennials (those born in the 1980s or 1990s) view themselves more as spenders than savers. The survey also reveals that 75% of millennials view social...
-
Fill in the blank(s) in each of the following statements: a) Lists and tables of values can be stored in _______. b) An array is a group of _______(called elements) containing values that all have...
-
Briefly describe each of the following terms: a) Toolbar b) Menu bar c) Toolbox d) Control e) Form f) Solution
-
Write C# statements that accomplish each of the following tasks: a) Display the message "Enter an integer: ", leaving the cursor on the same line. b) Assign the product of variables b and c to...
-
Eugene Fama and Robert Shiller recently won the Nobel Prize in economics. Go to http://nobelprize.org/nobel_prizes/economics/ and locate the press release on Eugene Fama and Robert Shiller. What was...
-
Visit the Bloomberg Markets website at www.bloomberg.com/markets/stocks. Their interactive graph allows you to see cumulative returns for individual stocks as well as market indices. Over the last...
-
Compute the price of a share of stock that pays a \($5\) per year dividend and that you expect to be able to sell in one year for \($40\), assuming you require a 5% return.
Study smarter with the SolutionInn App