Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

4. (find_future_dates.cpp) Write a C++ program that prompts the user to enter an integer (from 0 to 6) for today's day of the week (Sunday

image text in transcribed

4. (find_future_dates.cpp) Write a C++ program that prompts the user to enter an integer (from 0 to 6) for today's day of the week (Sunday is O, Monday is 1, ..., and Saturday is 6) and another integer (any positive integer) for the number of days after today to show a future day. a. Use variables to store current day and future day. b. Use switch to find out what day of the week is today. C. Use if-else if-else to find out what day of the week is the future day. d. Check that the first input is between 0 and 6 inclusively, and the second input is positive. If they are invalid, the program terminates and prints error messages. See below for the error messages. Here are the sample runs: Enter today's day: 1 Enter the number of days elapsed since today: 10 Today is Monday and the future day is Thursday Enter today's day: 10 Enter the number of days elapsed since today:10 Invalid today's day, it should be between 0-6 inclusively Enter today's day: 1 Enter the number of days elapsed since today: -1 Invalid number of days elapsed, it must be positive

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions