Question: [ Prob . 6 . Fundamental of Programming ] ( 4 0 % ) Consider the following class of a C + + code :
Prob Fundamental of Programming
Consider the following class of a code :
class Date
public:
Dateint 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 and and the day value is between and If any one of
these two conditions is not satisfied, your program must exit.
Explain difference between the private member variables and the public member
variables of a class as for their accessibility.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
