METAR Abbreviations

METAR (Meteorological Aviation Report) is a format for reporting weather information, either for pilots in pre-flight weather briefings or by meteorologists to aid them in weather forecasting.

Look up the English meanings of these METAR abbreviations online (Wikipedia is a good source):

+ - B DZ E HZ RA SN

Write a Java program that reads one of these eight abbreviations, then prints its English meaning. Use an if..else statement to do the translation.

If the input does not match any of these eight abbreviations, print "Unknown abbreviation".

Here is a METAR tutorial from Weather Underground to help you decode this METAR report. You can also consult Wikipedia for an overview of METAR.

Note: don't use the == operator for String objects, use the String equals method instead as in the NumToWords Example in the num-to-words file.

Here is a sample METAR report:

SPECI KPWK 042100Z 05010KT 10SM BKN030
OVC036 M01/M08 A3049 RMK AO2 T10111078

Translation:

SPECI means that this is an unscheduled METAR report issued when certain criteria are met.
KPWK is the airport identifier for Chicago Executive Airport 18 miles northwest of the city center.
Z means Zulu time (Coordinated Universal Time): 4:21:00pm.
KT means wind direction and speed: direction 50 degrees clockwise from North and speed 10 knots.
SM means visibility: 10 miles.
BKN means clouds with cloud bottoms at 3,000 ft. are broken (cover 5/8 to 7/8 of sky).
OVC means that clouds with cloud bottoms at 3,600 ft. are overcast (cover all of the sky).
M01/M08 means that the temperature is minus 1 Celsius and that the dew point is minus 8 Celsius.
A indicates an altimeter pressure reading of 10.49 inches of mercury.
RMK means that the Remarks Section follows.
A02 indicates that the station is automated with a precipitation discriminator
T10171017 is a breakdown of the temperature and dew point in eight digits separated into two groups of four.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.