Professional Documents
Culture Documents
CLASS BEE-3C
InLab TASKS
Output:
Task2
Output
Task3
Output
Task4
Output
Post lab task :
Output
Code
#include <iostream>
#include <string>
using namespace std;
class Date{
private:
int month;
int day;
int year;
public:
Date(){
month = 1;
year = 1900;
day = 1;
}
void printDate(){
cout<<year<<"/";
if(month>9){
cout<<month<<"/";
}else{
cout<<"0"<<month<<"/";
}
if(day>9){
cout<<day;
}else{
cout<<"0"<<day;
}
}
};
int main() {
Date dateDefault;
int m,y,d;
cout<<"\nEnter month : ";
cin>>m;
cout<<"Enter day : ";
cin>>d;
cout<<"Enter year : ";
cin>>y;
dateDefault.setDate(m,d,y);
cout<<"Entered date is : ";
dateDefault.printDate();
}