PROBLEM 1:The National Earthquake Information Center has the following criteria to determine the earthquake damages. Here is the given richter scale serve as an input data and the characterization as output information.
RICHTER NUMBER (N)....CHARACTERIZATION
N%26lt;5.0---------little or no damage
5.0%26lt;=N%26lt;5.5-----some damage
5.5%26lt;=N%26lt;6.5.---serious damage
6.5%26lt;=N%26lt;7.5----Disaster
Higher.---------Catastrophe
Solution: use the else if case conditional statement.
Problem 2:
Write a program in C for the Air force to label an aircraft a military or civilian.The program is to be given the plane's observed speed in km/h %26amp; its estimated length in meters.For plane travelling in excess of 1100km/h %26amp; longer than 52m, you should label them as"civilian"aircraft,%26amp; shorter such as 500 km/h %26amp; 20m as"military"aircraft. For planes travelling at more slower speeds,you will issue an "It's bird"message.
SOLUTION:use ladderized case conditional statement.
Problems in program in C-Language.. [Please help me!!]?
May be you can search at project assignment help website like http://askexpert.info/
Reply:1)
double n=0;
Console.Writeline("Enter Richter number");
Console.Readline(n);
if (n%26lt;5)
Console.Writeline("little or no damage");
else if (n%26gt;=5 %26amp;%26amp; n%26lt;5.5)
Console.Writeline("some damage");
else if (n %26gt;=5.5 %26amp;%26amp; n%26lt;6.5)
Console.Writeline("serious damage");
else if (n %26gt;= 6.5 %26amp;%26amp; n%26lt;7.5)
Console.Writeline("Disaster");
else
Console.Writeline("Catastrophe");
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment