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
-
What are the particular vulnerabilities of women and girls in outbreaks of genocide? Are men more genocidal than women? What is the role of gendered propaganda in pre-genocidal and genocidal contexts?
-
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...
-
A decision alternative with the highest Expected Value A) Is always preferred B) Reflects factors such as risk, image or other nonmonetary criteria C) Is preferred when the Expected Value is within a...
-
A company needs 150,000 items per year. It costs the company $360 to prepare a production run of these items and $7 to produce each item. If it also costs the company $0.75 per year for each item...
-
For each of the following ratios, is a high ratio or low ratio considered, in general, a positive sign? a. Current ratio b. Quick ratio c. Operating-cash-flow-to-current-liabilities ratio d. Accounts...
-
On January 1 of the current year, Rhondell Corporation has accumulated E & P of $13,000. Current E & P for the year is $84,000, earned evenly throughout the year. Elizabeth and Jonathan are sole...
-
Danner Company wish to maintain beginning and ending cash balance of $ 40000 on January 1, 2017. Relevant monthly budget data for the first 2 months of 2017 are as follows. Collections: January...
-
Get It Right, CPAs, has been retained to review its client's corporate formation calculations for 20XX. Maria, Roger, and Novak created Grassroots Tennis, Inc. (GTI), which began operations on March...
-
Sunflowers Inc. has used two different suppliers and is considering which one to choose to buy materials from for next year. Supplier A offers a fixed price of $10 per unit of material. Supplier B...
-
Explain the difference between a voluntary and mandatory change in accounting policy.
-
What does it mean to "recast" the financial statements? Why are financial statements recast?
-
We have had Paige & Gentry as our auditors for many years, havent we, Jane? They have been here since I became president two years ago. Yes, Bob, I have been the CFO for seven years, and they were...
-
A railroad company is trying to decide how to charge its customers for carrying freight. A manager suggests the following would be a good measure upon which to base the price of transporting freight:...
-
If there is doubt about whether a change is a change in policy or a change in estimate, how should it be treated? Why do you think accounting standards have this requirement?
-
UPS, a delivery services company, has a Beta of 1.10, and Wal-Mart has a Beta of 0.70. The Risk-Free Rate of return is 4.50% and the expected return of the market portfolio is 11.50%. What is the...
-
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...
-
The following information is taken from Procter & Gambles 2015 annual report: Calculate the companys actual and sustainable rate of growth in sales for 2015 and 2014. How do the two growth rates...
-
The following information is taken from the Fossil, Inc. 2015 annual report: Calculate Fossils actual and sustainable rate of growth in sales. How do the two rates of growth compare? What advice...
-
Presented below are selected financial data from the 2015 annual report of the Bristol-Myers Squibb Company: Required Using the ratio definitions from Exhibit 4.6, calculate the financial ratios for...
Study smarter with the SolutionInn App