Question: [ Prob . 6 . Fundamental of Programming ] ( 4 0 % ) Consider the following class of a C + + code :

[Prob.6. Fundamental of Programming]
(40%) Consider the following class of a C++ code :
class Date
{
public:
Date(int monthValue, int dayValue);
//A constructor that takes the month and the day values.
private:
int month;
int day;
}
Write the definition part of the above constructor. Your code should check whether the
month value is between 1 and 12, and the day value is between 1 and 31. If any one of
these two conditions is not satisfied, your program must exit.
(25%) Explain difference between the private member variables and the public member
variables of a class as for their accessibility.
 [Prob.6. Fundamental of Programming] (40%) Consider the following class of a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!