Description
Tornado data for Oklahoma, 2022, is stored in a file named tornado.txt. A copy of the data file is posted in D2L under the Course Materials for Unit 6. The data is stored with no column headings, a space between each data item and a return after the path width data for each tornado.
Ref: https://www.weather.gov/oun/tornadodata-ok-2022
Fujita Scale
(EF rating) |
Path Length (miles) |
Path Width (yards) |
1 | 7.0 | 50 |
2 | 5.0 | 200 |
1 | 10.0 | 200 |
1 | 6.7 | 700 |
1 | 0.5 | 240 |
1 | 5.6 | 1400 |
1 | 7.0 | 500 |
2 | 12.0 | 1760 |
1 | 14.0 | 1350 |
1 | 0.4 | 150 |
- Write a program to read the tornado.txt file and create a report.
- Store the tornado report into a file named report.txt.
- The report should contain the following data for each part, printed in columns:
- EF rating
- Path Length (miles)
- Path Width (yards)
- Affected Area (sq miles)
- Below the part table, print the total area affected.
- You should have separate functions to:
- Read a line of data.
- Calculate the area affected for one tornado and keep a running total of the areas.
- Print one line in the report.
- Your program should work with files containing fewer or more records (lines) than those shown in the table above.
*** A similar example program, labelled “Student Grades” is posted under Content for Unit 6.
Design your program by completing the CS 150 Program Design Document. Be sure to include a structure chart for the program, the prototype for each function, and a brief description of each function’s purpose. Save the design in a file named Tornado_xxx.doc where xxx are your initials and submit it in the Program 6 Design drop box by the date shown in the calendar – this is before the program due date.
Code your program. Save it in a file named tornado_xxx.cpp where xxx are your initials.
Compile, run and test your program.
Submit your working .c file in the Program 6 drop box by the due date shown in the calendar.