Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In visual studio C++ Write a class definition for a Date class that contains 3 private integer data members: month, day, and year Create public

In visual studio C++

image text in transcribed

Write a class definition for a Date class that contains 3 private integer data members: month, day, and year Create public member functions setDate() and showDate(). The set Date) function should accept 3 integer arguments and use them to set the private members month, day, and year. If the user provides invalid information for the day or month, set it to a default of 1. (ex. if the user enters a month of O and day of 32, set the month to 1(January) and day to 1st) (this is different than allowing the user to call setDate) with zero input arguments and using defaults for all3 values) The error checking should be very precise. Ex. Since April only has 30 days, no one should be able to set a date of April 31st. The error checking for February should account for the fact that Feb has 28 days during some years and 29 days other years. The program should also be able to recover if the user types in letters when numeric input is expected

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

2. Outline the business case for a diverse workforce.

Answered: 1 week ago