Question
We'll keep it light. The main objective for this assignment is to get your IDE set up and successfully compile and execute your first C++
We'll keep it light. The main objective for this assignment is to get your IDE set up and successfully compile and execute your first C++ program.
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 date in the format specified above (month/day/2-digit-year). (It 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.
Hints: do not use any string variables. The program will be much simpler if you read the three data into three separate int variables. This may require a deeper understanding of the extraction operator than has been needed up to this point in your programming experience. For example, 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 2.9 before starting on this assignment.
Here is a sample run (user's input shown in bold):
Enter a date in the format month/day/2-digit-year: 6/10/60 That is a magic date!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started