Here is what I have written so far, everything is compiling fine. Thanks for the quick response.
Code:
#include<stdio.h>
/* Function prototypes*/
void instruct_user(void);
int
main(void)
{
double n; /* Represents the number registered on Richter Scale */
/* Display user instructions.*/
instruct_user();
/* Get user input*/
printf("Enter the number registered on the Richter scale and press return> ");
scanf("%1f", &n);
/*The decision making process based on a Multiple-Alternative Decision order of conditions*/
/*A switch statement could not be used when inputing type double there for if else is more appropriate.*/
if (n<5.0)
printf("There will be little or no damage with this earthquake.\n\n", n);
else if (n>=5.0 && n<5.5)
printf("There will be some damage with this earthquake.\n\n", n);
else if (n>=5.5 && n<6.5)
printf("There will be serious damage with this earthquake: walls may crack or fall.\n\n", n);
else if (n>=6.5 && n<7.5)
printf("Disastrous results will occur with this earthquake: houses and buildings may collapse.\n\n", n);
else
printf("Catastrophic results will occur with this earthquake: most buildings will be destroyed.\n\n", n);
return (0);
}
/* Displays user instructions*/
void
instruct_user(void)
{
printf("This program will take input from the user and provide the user with the affects\n");
printf("of an Earthquake based on it's Richter scale.\n\n");
}