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...
-
Fergiehas the choice between investing in a State of New York bond at 5 percent and a Surething bond at 8 percent. Assuming that both bonds have the same nontax characteristics and that Fergiehas a...
-
Describe the function of a dark pool.
-
Refer to the December 31, 2002, balance sheet Harley- of Harley-Davidson in Appendix A. What Davidson long-term assets discussed in this chapter are reported?
-
The financial statements of Marks and Spencer plc (M&S) are available at the books companion website or can be accessed at corporate.marksandspencer....
-
w Quiz A protected wilderness area in the shape of a rectangle is 3 kilometers long and 3.4 kilometers wide. The forest is to be surrounded by a $12,000 per mile to construct. What will it cost to...
-
Kepler's second law states that as a planet moves around in its orbit, it sweeps out equal areas in equal times. Examine the following figure, which shows a planet (blue dot, labeled "E"), orbiting...
-
Queen, Ltd. has one product. Its sales price and variable cost per unit are $25 and $20, respectively. Last year, Queen sold 25,000 units, which was 5,000 more than the break-even point. What were...
-
Wookie Company issues 7%, five-year bonds, on January 1 of this year, with a par value of $101,000 and semiannual interest payments. Semiannual Period-End (0) January 1, issuance (1) June 30, first...
-
"Productivity is finding better ways to make something - using less resources, people and capital. When you look at productivity it does not grow at a steady pace...if you look at productivity since...
-
What is international labor outsourcing, and what are its impacts on market wages and equilibrium levels of employment in affected nations? Why do labor and capital resources often flow across...
-
Think of a time where you experienced debilitative emotions and give a brief summary of that situation. What conditions influenced those emotions? If you could go back in time, what communicative...
-
Simplify the expression log5(250).
-
3. To the right of the Projects table Camille wants you to summarize project information. Start by calculating the number of each project type. a . Use a function to count the number of expansion...
-
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...
-
Is the of a diversified conglomerate close to 1? Why?
-
As a result of a change in the nature of its business, there is a relative rise in the proportion of fixed costs in a group As total costs. Will this affect the risk attached to its share price? If...
-
What law of statistics explains that in the long term, risk disappears? State your views.
Study smarter with the SolutionInn App