subject

In c++ in this assignment, you will write a program that will read in a list of 12 doubles from a file. each double represents the total rainfall in inches for the 12 months of the year in month order. the 12 doubles should be written into an array. the program should do the following with the data: ? calculate the average rainfall for the year. ? determine which month had the lowest amount of rainfall. ? determine which month had the highest amount of rainfall. ? sort the array of rainfall in descending order (highest rainfall first) using a bubble sort. ? neatly display the average, minimum, and maximum rainfall. be sure to display the month of the minimum and maximum rainfalls. then display a table of month and rainfall amount from the sort that you did earlier. each of the monthly rainfall, average, minimum, and maximum rainfalls should be displayed to two decimal places. you will not be given a sample program for this assignment. you have already done a similar program for reading in values from a file and finding averages, minimums, and maximums. the most difficult part of the assignment will be to display the correct months with the correct rainfall values after you have sorted them. i would suggest using parallel arrays for rainfall and months and every time you swap array indices for rainfall, you do the same swap for the months. make sure you use good programming style. this includes commenting all your variables and commenting through your code. comments should explain why you are doing something. use good indentation (see my examples and the books examples for demonstration of good indentation). make sure variable names are self-documenting. make good use of white space. group logical sections together with one blank line between logical sections. your output should be neat and pleasant to read. make sure you follow the specifications. if you must, you can add to the program, but do not change the specifications in doing so. name your file pa4_lastname_firstname. cpp, replacing lastname with your actual last name and firstname with your actual first name. failure to properly name your file results in loss of points. cosc 1436 programming assignment 4 below is possible output for a sample run for this programming assignment: monthly rainfall for fort worth, tx 2014 minimum: september 0.06 maximum: august 4.34 monthly average for year: 1.77 sorted by total rainfall month inches august 4.34 may 3.40 june 3.26 november 2.13 october 2.09 april 1.74 march 1.45 december 1.13 july 0.98 february 0.41 january 0.33 september 0.06

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
Singing in the rain: this first part of the film shows the early history of motion picture. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theater productions? explain.
Answers: 1
question
Computers and Technology, 24.06.2019 08:50
Write a program that will compute the volume of ice cream served in a cone. as you can see in the diagram below, the ice cream is served as a hemisphere of frozen deliciousness on top of a cone, which is also packed with frozen deliciousness. thus, the total volume of ice cream sold is the volume of the hemisphere plus the volume of the cone. the example shows an ice cream cone in which the hemisphere and cone have a radius of 10 inches and the cone has a height of 15 inches. your program must instead prompt for these two values, which are taken from the keyboard as integers: • the hemisphere/cone radius in inches, and
Answers: 3
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Select all that apply. what two keys listed below should you use to enter data in an excel worksheet? tab backspace enter right arrow
Answers: 2
You know the right answer?
In c++ in this assignment, you will write a program that will read in a list of 12 doubles from a fi...
Questions
question
English, 20.10.2021 14:00
Questions on the website: 13722367