CS201 Assignment 3 Solution 2022

VU Answer Gives Perfect CS201 Assignment 3 Solution Fall 2021. It's a Complete Step by Step CS201 Assignment 3 Solution 2022 to Get Easily Help and Get the idea.


Download PDF, CPP, and Word Solution File Below.



CS201 ASSIGNMENT 3 SOLUTION FALL 2021 

Provide by VU Answer


Total Marks: 20

Due Date: 10-Feb-2022


Must Fellow Assignment Submission and Special Instruction:

Submit your file in .cpp format only.

You will write your own student VU Id and name in attributes (empId and empName) respectively, otherwise, you will not get any grades



CODE Solution:


#include<iostream>

using namespace std;

class Employee

{

private:

string emp_Id;

string emp_Name;

int joiningYear;

int joiningMonth;

int joiningDate;

public:

Employee()

{

emp_Id = "<<EMPTY>>";

emp_Name = "<<EMPTY>>";

joiningYear=0;

joiningMonth=0;

joiningDate=0;

}

Employee(string id, string name, int year, int month, int date)

{

emp_Id = id;

emp_Name = name;

joiningYear=year;

joiningMonth=month;

joiningDate=date;

}

void setValues(Employee *emp2)

{

emp_Id = emp2->emp_Id;

emp_Name = emp2->emp_Name;

joiningYear=emp2->joiningYear;

joiningMonth=emp2->joiningMonth;

joiningDate=emp2->joiningDate;

}

string getId()

{

return emp_Id;

}

string getName()

{

return emp_Name;

}

int getYear()

{

return joiningYear;

}

int getMonth()

{

return joiningMonth;

}

int getDate()

{

return joiningDate;

}

void display(Employee emp)

{

cout<<"ID: "<<emp.getId()<<"\n";

cout<<"Name: "<<emp.getName()<<"\n";

cout<<"Joining Year: "<<emp.getYear()<<"\n";

cout<<"Joining Month: "<<emp.getMonth()<<"\n";

cout<<"Joining Date: "<<emp.getDate()<<"\n\n";

}

};

int main()

{

Employee emp1;


Employee emp2("BC200210341", "Muhammad Sarim (VU Answer)", 2020,12,12);


cout<<"Employee 1 Using default Constructor:"<<"\n\n";

emp1.display(emp1);


cout<<"Employee 2 Using Parameterized constructor:"<<"\n\n";

emp2.display(emp2);

cout<<"Employee 1 having Employee 2 copied data member values"<<"\n\n";

emp1.setValues(&emp2);

emp1.display(emp1);

return 0;

}





CS201 Assignment 3 Solution 2022 Download .CPP File


CS201 Assignment 3 Solution 2022 Download Word File




CORRECT CODE OUTPUT BELOW



















PLEASE NOTE:


Make sure you can make some changes to your solution file before submitting copy-paste solution will be marked zero.

Before submitting an assignment check your assignment requirement file.


REGARD SARIM 

WHATSAPP +923162965677



CS201 Assignment 3 Solution 2022


CS201 Assignment No 3 Solution Fall 2021


CS201 Assignment 3 Solution Fall 2022


CS201 Assignment Solution 2022