February 19, 2010

ACM ICPC contest problems


Typoon Ondoy

On September 26,2009, Typhoon Ondoy brought a month's worth of rainfall to Metro Manila
and nearby areas in just a few hours, causing severe flooding which resulted int eh loss
of many lives and the displacement of hundreds of thousands of people. Areas under
Storm Signal No.2 included:Aurora,Quirino,Nueva Vizcaya, Nueva Ecija,Pangasinan, Tralac,
Zambales,Pampanga, bulacan, Rizal,Northern Quezon, and Polillo Island.The Philippine Atmospheric Geophysical and Astronomical Services Administration (PAG-ASA)
has come up with a measure to classify typhoons based on wind speed (in kph):
Tropical depression have wind speeds of 30 to 46 kph (inclusive)
Tropical storms have wind speeds between 47 kph and 89 kph (inclusive)
Typhoons have wind speeds between 90 kph and 183 kph (inclusive)
Super Typhoons have wind speeds greater than 183 kph
Programmer Oliver
Decembe 10,2009

+++++++++++++++++++++++++++++++++++++++++
import java.util.*;
public class TyphoonOndoy
{
static Scanner console=new Scanner (System.in);
public static void main()
{
int windSpeed;
System.out.print("Enter Wind Speed (in kph)>>\t\n");
windSpeed=console.nextInt();
if (windSpeed>183)
System.out.print("It is a Super typhoon");
else if(windSpeed>90)
System.out.print("It is a Typhoon");
else if (windSpeed>47)
System.out.print("It is a Tropical Storm");
else if (windSpeed>30)
System.out.print("It is a Tropical Depression");
else
System.out.print("No classification for this wind speed");
}
}

No comments:

Post a Comment