Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that the earthquake has hit three villages in Himalayan Mountains. Write a C program to display the severity of damage to each village based

Assume that the earthquake has hit three villages in Himalayan Mountains. Write a C program to display the severity of damage to each village based on the Richter scale number. Also, identify the village with the most damage for immediate help. The following table is provided by the National Earthquake Information Center to characterize an earthquake based on its Richter scale number:

Richter Scale Number (n)

Characterization

n < 5.0

Little or no damage

5.0 n < 5.5

Some damage

5.5 n < 6.5

Serious Walls may crack or fall

6.5 n < 7.5

Disaster houses may collapse

7.5 n

Catastrophic most buildings destroyed

In the main() function:

Declare variables with proper data types and meaningful names at the beginning of the main() function.

Display above table to the screen.

Prompt the user to enter the Richter scale number for each village (lets call them richter_villege1, richter_villege2, and richter_villege3).

Use a cascading if statement to characterize the earthquake in each village, and display a descriptive message to the screen.

Identify the village with the highest Richter scale number (assume there are 3 different numbers). Display a descriptive message to send immediate assistance to this village.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions