Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago