The following table that is available in a file “rain.txt" shows the amount of rain in mm³ that fell in Rembau, Negeri Sembilan for the year of 2020. Write a program that does the following tasks: 1. reads these data and write the data in a file "out.txt". 2. determines the highest amount of rain along with the month it occurs and write the results in the file "out.txt". 3. sort in ascending order the monthly amounts of rain and write the results in the file "out.txt".

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 9PP: (Inventory) Create an ASCII file with the following data, or use the shipped.dat file available on...
icon
Related questions
Question

In pseudocode 

The following table that is available in a file “rain.txt" shows the amount of rain in mm³ that fell
in Rembau, Negeri Sembilan for the year of 2020. Write a program that does the following tasks:
1. reads these data and write the data in a file “out.txt".
2. determines the highest amount of rain along with the month it occurs and write the results
in the file "out.txt".
3. sort in ascending order the monthly amounts of rain and write the results in the file
"out.txt".
Input data in rain.txt
-3-
January
4.2597
February
3.5983
March
2.2356
Аpril
1.2743
Mei
1.5433
June
0.1346
July
0.2658
August
0.6923
September
1.2496
October
2.5557
November
4.5983
December
5.2376
Sample output in out.txt
MONTHLY RAIN
Location: Rembau, Negeri Sembilan
Year: 2020
January
4.2597
February
3.5983
March
2.2356
April
1.2743
Mei
1.5433
June
0.1346
July
0.2658
August
0.6923
September
1.2496
October
2.5557
Transcribed Image Text:The following table that is available in a file “rain.txt" shows the amount of rain in mm³ that fell in Rembau, Negeri Sembilan for the year of 2020. Write a program that does the following tasks: 1. reads these data and write the data in a file “out.txt". 2. determines the highest amount of rain along with the month it occurs and write the results in the file "out.txt". 3. sort in ascending order the monthly amounts of rain and write the results in the file "out.txt". Input data in rain.txt -3- January 4.2597 February 3.5983 March 2.2356 Аpril 1.2743 Mei 1.5433 June 0.1346 July 0.2658 August 0.6923 September 1.2496 October 2.5557 November 4.5983 December 5.2376 Sample output in out.txt MONTHLY RAIN Location: Rembau, Negeri Sembilan Year: 2020 January 4.2597 February 3.5983 March 2.2356 April 1.2743 Mei 1.5433 June 0.1346 July 0.2658 August 0.6923 September 1.2496 October 2.5557
November
4.5983
December
5.2376
The highest rain is 5.2376 mm2 in December.
Rains in ascending order:
June
0.1346
July
0.2658
August
0.6923
September
1.2496
April
1.2743
Mei
1.5433
March
2.2356
October
2.5557
February
3.5983
January
4.2597
November
4.5983
December
5.2376
Transcribed Image Text:November 4.5983 December 5.2376 The highest rain is 5.2376 mm2 in December. Rains in ascending order: June 0.1346 July 0.2658 August 0.6923 September 1.2496 April 1.2743 Mei 1.5433 March 2.2356 October 2.5557 February 3.5983 January 4.2597 November 4.5983 December 5.2376
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Storage Devices
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr