Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07 26 1998. The program will print the number of days elapsed from 01 January of that year, i.e. January 1st is always 1 and December 31 is either 365 or 366, depending on if leap year or not.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 30PE
icon
Related questions
Question

PLEASE CODE THIS IN VISUAL CODE & MAKE SURE IT RUNS

PROBLEM:
Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07 26 1998. The program will print the number of days elapsed from 01 January of that year, i.e. January
1St is always 1 and December 31 is either 365 or 366, depending on if leap year or not.
TEST CASES:
If a user inputs a valid int month, date, and year:
Enter MM: 05
Enter DD: 18
Enter YYYY: 1995
Result: 138 days
If a user inputs an invalid int month, date, and year:
Enter MM: 02
Enter DD: 29
Enter YYYY: 1997
Result: INVALID
Transcribed Image Text:PROBLEM: Write a program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07 26 1998. The program will print the number of days elapsed from 01 January of that year, i.e. January 1St is always 1 and December 31 is either 365 or 366, depending on if leap year or not. TEST CASES: If a user inputs a valid int month, date, and year: Enter MM: 05 Enter DD: 18 Enter YYYY: 1995 Result: 138 days If a user inputs an invalid int month, date, and year: Enter MM: 02 Enter DD: 29 Enter YYYY: 1997 Result: INVALID
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning