subject

What’s The Date? Design a struct called Date. The struct should store a specific date in three integers: month, day, and year.
Write a complete C++ program to use the struct Date that asks for a date entered at the keyboard, with the format mm/dd/ (strictly required, 3 points will be deducted for not applying the format). And then, the program will display the date in the following four forms, if it is valid:
12/25/2012 (US)
December 25, 2012 (US expanded)
25 December 2012 (US Military)
2012-12-25 (International)
Allow your program to run continuously as long as the user wishes to test with any other date entered.
Finally, your full name as the programmer who wrote the program must be displayed at the end.
Input validation: Do not accept any invalid input for a date. If it is, display the message "The date is invalid", and ask for another date. Leap year must be checked.
Required Input/Output
(must be similar to the following, where the bold characters are inputs)
The program displays a valid date in three different formats.
Note: All junk data will be rejected!
Enter a date (mm/dd/) or -1 to end: 2/29/2008
Invalid date/ wrong format: For both month and day, use two digits.
Re-Enter a date (mm/dd/) or -1 to end: 02/29/2009
2009 -> NOT Leap Year!
29 is not a valid day of February
Error!!! The entered date is invalid! Re-Enter, Please!
Enter a date (mm/dd/) or -1 to end: 02/29/2008
2008 -> Leap Year!
Date: 2/29/2008 is valid.
2/29/2008 (US).
February 29, 2008 (US Expanded).
29 February 2008 (US Military).
2008-02-29 (International).
Run again (y/n)? y
The program displays a valid date in three different formats.
Note: All junk data will be rejected!
Enter a date (mm/dd/) or -1 to end: 4/31/1975
Invalid date/ wrong format: For both month and day, use two digits.
Re-Enter a date (mm/dd/) or -1 to end: 04/31/1975
31 is not a valid day of April
Error!!! The entered date is invalid! Re-Enter, Please!
Enter a date (mm/dd/) or -1 to end: 04/30/1975
Date: 4/30/1975 is valid.
4/30/1975 (US).
April 30, 1975 (US Expanded).
30 April 1975 (US Military).
1975-04-30 (International).
Run again (y/n)? n
Programmer: FUll name – What’s the Date?
Press key to end ...

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, kikilax
What is linux? an open source operating system a version of ms dos the first version of unix the newest technology available
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, serellehunt
Which type of file can be used to import data into a spreadsheet?
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, Nason156
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
image
Computers and Technology, 23.06.2019 00:20, mmmmaaarriiieeee
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
You know the right answer?
What’s The Date? Design a struct called Date. The struct should store a specific date in three inte...

Questions in other subjects:

Konu
Mathematics, 22.05.2020 00:12