Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C + + program that reads in three integer values that represent a month, date, and four - digit year. Your program should

Write a C++ program that reads in three integer values that represent a month, date, and four-digit year. Your program should print the date in one of following formats depending on the user's input.
If the user enters 1, then print the month as a word ("January"), the date as an integer (11), and the year (1999).
If the user enters 2, then print the month as a three-letter abbreviation ( "Jan. "), date as an integer (11), and the year (1999).
If the user enters 3, then print month as an integer (01), the date as an integer (11), and the year (1999).
Here is a sample run (user's input shown in bold):
Please enter a date (three integers: month, day, year): 1211999
How would you like to print your date?
Month date, full year. (January 11,1999): Enter 1.
Abbreviated month date, full year (Jan.1,1999): Enter 2.
Month/date/year (12/1/1999): Enter 3.
1
If the user enters 1, then the output would be
December 1,1999.

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions