Question: In this project you may assume that the user will provide properly formatted, valid data. The date June 1 0 , 1 9 6 0
In this project you may assume that the user will provide properly formatted, valid data.
The date June is special because when we write it in the following format, the month times the day equals the year:
Write a program that asks the user to enter any date in the format specified above monthdaydigityearIt is very important that the input is in the correct format, typed all at once, all on one line, by the user. See the hints below. 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 message saying the date is not magic.
Do not use any string variables in this assignment.
Hint: Don't use getline
Hint: Read the three data into three separate int variables. Even though the user will be typing only one line of input, you will be using the extraction operator multiple times to read that input. I strongly suggest that you review lesson before starting on this assignment.
To make your job easier, we will specify that it is still a valid date if the user uses a different nonnumeric character instead of a slash. For example, q would be a valid date and a magic date
Here are some sample runs users input shown in bold:
Enter a date in the format monthdaydigityear:
That is a magic date!
Enter a date in the format monthdaydigityear:
That is not a magic date!
Enter a date in the format monthdaydigityear: w
That is a magic date!
Enter a date in the format monthdaydigityear: w
That is a magic date!
If you are having trouble handling the slashes, Id suggest that you begin by writing the following program, which is one step toward the complete program: Write and test a complete program that asks the user to enter a month followed by a single nonnumeric character, and then prints the month and punctuation character that were entered. Here is a sample run of this firststep program users input shown in bold:
Enter a month as an integer, followed by a punctuation character: #
You entered the month followed by the punctuation character #
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
