Question:

Magic Dates The date June 10, 1960 is special because when we write it in the following format, the month times the day equals t

Magic Dates
The date June 10, 1960 is special because when we write it in
the following format, the month times the day equals the year:
6/10/60
Write a program that asks the user to enter a month (in numeric
form), a day, and a two-digit year. The program should then
determine whether the month times the day is equal to the
year. If so, it should display a message saying the date is
magic. Otherwise, it should display a a message saying the
date is not magic.
Sample run 1:
Enter a month : 3
Enter a day
: 5
Enter a year (YY): 10
You entered 3/5/10.
This date is not magic.
Sample run 2
Enter a month : 6
Enter a day
Enter a year (YY): 60
.
10
O O
You entered 6/10/60.
This date is magic.

Magic Dates The date June 10, 1960 is special because when we write it in the following format, the month times the day equals the year: 6/10/60 Write a program that asks the user to enter a month (in numeric form), a day, and a two-digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is magic. Otherwise, it should display a a message saying the date is not magic. Sample run 1: Enter a month : 3 Enter a day : 5 Enter a year (YY): 10 You entered 3/5/10. This date is not magic. Sample run 2 Enter a month : 6 Enter a day Enter a year (YY): 60 . 10 O O You entered 6/10/60. This date is magic.

More Questions on Iterations & Loops

View all