Friday, November 10, 2023

Design Class Called Date

Programming Challenges

1. Date

Design a class called Date.

The class should store a date in three integers: month, day, and year.
There should be member functions to print the date in the following forms:
12/25/2014
December 25, 2014
25 December 2014
Demonstrate the class by writing a C++ complete program implementing it.
Input Validation:
Do not accept values for the day greater than 31 or less than 1.
Do not accept values for the month greater than 12 or less than 1.
a) Use program example Pr13-2.cpp as a template to create your own program.
b) Use program example 3: Pr13-3.cpp as a template to create your own program.

Solution "a"

https://onlinegdb.com/vQSP4S3nH

No comments:

Post a Comment

N-point Star in Microsoft Visual Studio Console App

#include <windows.h> #include <cmath> #include <iostream> LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,...