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, 23.06.2019 09:30
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
question
Computers and Technology, 23.06.2019 21:40
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
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, 03.10.2019 02:20
question
Mathematics, 03.10.2019 02:20
question
Social Studies, 03.10.2019 02:20
Questions on the website: 13722363