CS304 ASSIGNMENT NO2 SOLUTION WITH .CPP FILE

CS304 ASSIGNMENT NO2 SOLUTION WITH .CPP FILE

CS304 ASSIGNMENT NO2 SOLUTION WITH .CPP FILE. CS304 ASSIGNMENT 2 SOLUTION 2021. CS304 ASSIGNMENT 2 SOLUTION SPRING 2021

SEE ALSO:

CS302 ASSIGNMENT 2 SOLUTION 2021

CS504 ASSIGNMENT 2 SOLUTION 2021

CS605 ASSIGNMENT 2 SOLUTION 2021

CS401 ASSIGNMENT 2 SOLUTION 2021

CS604 ASSIGNMENT 2 SOLUTION 2021

CS603 ASSIGNMENT 2 SOLUTION 2021

CS610 ASSIGNMENT 2 SOLUTION 2021

CS607 ASSIGNMENT 2 SOLUTION 2021

CS609 ASSIGNMENT 2 SOLUTION 2021

CS301 ASSIGNMENT 2 SOLUTION 2021

CS604 ASSIGNMENT 1 SOLUTION 2021

CS403 ASSIGNMENT 1 SOLUTION 2021

CS402 ASSIGNMENT 1 SOLUTION 2021

CS609 ASSIGNMENT 1 SOLUTION 2021

CS605 ASSIGNMENT 1 SOLUTION 2021

CS615 ASSIGNMENT 1 SOLUTION 2021

CS431 ASSIGNMENT 1 SOLUTION 2021

CS435 ASSIGNMENT 1 SOLUTION 2021

CS204 ASSIGNMENT 1 SOLUTION 2021

CS304 ASSIGNMENT 2 SOLUTION SPRING 2021

HTTPS://T.ME/VUALLINONE

CS304 ASSIGNMENT NO2 SOLUTION WITH .CPP FILE

DOWNLAOD WORD FILE

DOWNLOAD .CPP FROM LINK BELOW:
DEAR FRIENDS NOW I AM GOING TO SOLUTION OF CS304 ASSIGNMENT NO 2
THERE MAY BE SOME MISTAKE OR WRONG ANSWERS IN ASSIGNMENT PLEASE VERIFY THEM BY CONSULTING YOUR HANDOUTS OF FROM THE INTERNET.

CODE IS BELOW:

#include <iostream>

#include <string>

 

using namespace std;

 

class Person{

private:

string FirstName;

string LastName;

int PersonalID;

double Salary;

 

public:

static int current_id;

//setter function

void setFirstName(string fn){

FirstName=fn;

}

void setLastName(string ln){

LastName=ln;

}

void setPersonalID(int pid){

PersonalID=pid;

}

void setSalary(double sl){

Salary=sl;

}

 

//Gettter function

string getFirstName(){

return FirstName;

}

string getLastName(){

return LastName;

}

int getPersonalID(){

return PersonalID;

}

 

 

Person() : PersonalID(current_id++) {}

 

};

 

int Person::current_id=8248001;

 

 

 

class HRM{

 

private:

Person employee;

 

public:

void AddPerson(string, string, double);

void DeletePerson();

void UpdatePerson();

 

string displayFN(){

return employee.getFirstName();

}

stringĀ  displyLN(){

return employee.getLastName();

}

void displaySal();

void displayID();

 

 

 

};

 

void HRM::AddPerson(string fn, string ln, double sal){

employee.setFirstName(fn);

employee.setLastName(ln);

employee.setSalary(sal);

 

}

 

 

int main(){

 

HRM h1;

string fn, ln;

double sal;

 

cout<<“Enter First Name :” ;

cin >> fn;

cout<<“Enter last Name : “;

cin>>ln;

cout<<“Salar : “;

cin>>sal;

 

h1.AddPerson(fn,ln,sal);

 

cout<<endl<<“First Name\t\tLast Name \t\t Personal ID\t\tSalary per Year(Rupees)”<<endl;

cout<<endl<<“————-\t\t—————\t\t ————–\t\t———————“<<endl;

 

cout<<endl<<h1.displayFN()<<“\t\t”<<h1.displyLN()<<endl;

 

 

 

 

}

Related Posts

Leave a Reply

%d bloggers like this: