This problem set covers Chapter 3.

Check Date String (5 points)

(Programming Projects #9, Page 191) Write a program that reads a string from the keyboard and test whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid.

The input date will have the format mm/dd/yyyy. A valid month value mm must be from 01 to 12. The day value dd must be from 1 to a value that is appropriate for the given month. September, April, June, and November each have 30 days. February has 28 days except for leap years when it has 29 days. The remaining months all have 31 days each. A leap year is any year that is divisible by 4 but not divisible by 100 unless it is also divisible by 400.

Extra Credit As an extra challenge, allow the date to also be entered as Month dd, yyyy, as in September 28, 2012.

Name this program CheckDateString

Temperature Converter Window (5 points)

(Programming Projects #5, Page 190) + (Programming Projects #7, Page 191) Write a program that allows the user to convert a temperature given in degrees from either Celcius to Farenheight or Farenheight to Celcius. Use the following formulas:

Degrees_C = 5 (Degrees_F - 32)/9
Degrees_F = (9/5)Degrees_C + 32

Prompt the user to enter a temperature followed by either 'C' or 'c' for Celcius or a temperature followed by 'F' or 'f' for Farenheight. Convert the temperature to Farenheight if Celcius is entered, or to Celcius if Farenheight is entered. Display the result in a readable format. If anything other than 'C', 'c', 'F', or 'f' is entered, print an error message and stop.

Use JOptionPane which is described in the graphics supplement at the end of Chapter 2.

Name this program TemperatureConverterWindow

Colored Olympic Rings (5 points)

(Programming Projects #12, Page 192) Write a java application to draw the five interlocking rings that are the symbol of the Olympics. The color of the rings from left to right, is blue, yellow, black, green and red.

Name this program ColoredOlympicRings