C Program for Tsunami Analysis


INTRODUCTION:

Tsunamis are large destructive waves that are generated by earthquakes, underwater volcanoes, and underwater landslides.  They can travel large distances and in deep water, like oceans, they can have a speed of more than 400 miles per hour.  In 1899 a very large tsunami was recorded in the Gulf of Alaska with a height of 197 feet, and an even larger tsunami was recorded in 1964 with a height of 230 feet.

ASSIGNMENT:

Tsunami data has been collected from 1992 to 1998 and placed in a file containing the date it was recorded, the location, the wave height in feet, and the number of fatalities.  The input file is called tsunamis.  Using an array of structures, write a C program that will compute the average wave height, find the minimum and maximum wave heights, and determine the tsunamis that were greater than the average wave height and print the tsunami location.  Finally, sort the tsunami data by wave height where the lowest wave height is first and the highest wave height is last.  Print the results to the computer screen and to an output file called tsunami_report.  The output format is given below.

OUTPUT FORMAT:

*****************************************************************

TSUNAMI ANALYSIS

Month       Day   Year   Location        Wave Height   Fatalities

—————————————————————–

sssssssss    xx   xxxx   ssssssssssssssss    xx.x         xxxx

.         .     .           .              .            .

.         .     .           .              .            .

.         .     .           .              .            .

 

 

 

 

 

sssssssss    xx   xxxx   ssssssssssssssss    xx.x         xxxx

 

Summary Report:

Minimum wave height in feet: xx.x

Maximum wave height in feet: xx.x

Average wave height in feet: xx.x

 

The tsunamis with greater than the average wave height are:

ssssssssssssssss

.

.

.

*****************************************************************

Leave a Reply

Your email address will not be published. Required fields are marked *



  • File Format: C .c, Output file .txt
  • Custom Solution Available: Yes, write to info@libraay.com to book a fresh code request