CS201: Assignment No 04 Solution | Virtual Study Solutions

Adsetra Ads

 

Cs201 Introduction to Programming

cs 201 Assignment no 4:

Please read the following instructions carefully before submitting assignment.
It should be clear that your assignment will not get any credit if:

The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
Assignment is copied(partial or full) from any source (websites, forums, students, etc)

Objective:

The objective of this assignment is to provide an on hand experience of:
Learn to use object oriented concept
Learn to map real world problem in the context of computer programming
Guidelines:

Create a class for “StaffRegistration”.
Provide getter and setter functions for each data member.
Use two member functions “InputStaffData()” and “DisplayStaffData()” for getting input and displaying it respectively.
Code should properly be indented and well commented.
Follow C/C++ rules for code documentation.
Use only Dev-C++ for this assignment. If you are using any other tool then mention it at top of your code file as comments.

Assignment Description

Etradehouse is an online shopping store, which deals with selling of goods across Europe. They have regional offices in different countries (Pakistan, China & UK). The support, purchase and sales staff works in regional office (Pakistan).
They hire new employees in order to run their business smoothly, but currently they have no automated system for hiring of their employees. As a C++ programmer, your task is to write a computer program in C++ which could register the newly hired staff and then display summary of it.

The data about the staff, that the company is interested are as follows:-
CNIC ( National Identity Card Number in the form XXXXX-XXXXXXX-X)
Name ( Name of employee)
Father Name
Date of Birth
Qualification
Designation
Salary
Joining Date
Contact Number
Address
Your Task
Your task is to create the program which produces the output as shown in “screenshot”.
Screenshot of the desired  output:
Here display your name & VU ID.

Note
Object oriented approach MUST be used in order to implement the assignment.
Submission
You are required to  your assignment through LMS in zip format containing two files.
Your solution C++ program i.e .cpp file
An MS Word document containing screenshot of your program output/execution

Cs 201 Assignment No 4 Solution:

#include
using namespace std;
class StaffRegistration
{
private:
char cnic[16];
char name[20];
char fname[20];
char dob[11];
char degree[10];
char desig[15];
int sal;
char joinDate[11];
char cell[13];
char address[40];
public:
void InputStaffData()
{
cout"\nPlease enter National Identity Card Number(CNIC)"endl;
cin>>cnic;
cout"Please enter name"endl;
cin >> name;
cout"Please enter father name"endl;
cin >> fname;
cout"Please enter date of birth (dd/mm/yyyy)"endl;
cin>>dob;
cout"Please enter qualification"endl;
cin>>degree;
cout"Please enter salary"endl;
cin>>sal;
cout"Please enter joining date (dd/mm/yyyy)"endl;
cin>>joinDate;
cout"Please enter contact number"endl;
cin>>cell;
cout"Please enter address information"endl;
cin>>address;
cout"Record added successfully !!!"endlendl;
}
void DisplayStaffData()
{
cout"CNIC: \t\t\t"cnicendl;
cout"Name: \t\t\t"nameendl;
cout"Father Name: \t\t"fnameendl;
cout"DoB: \t\t\t"dob endl;
cout"Qualification: \t\t"degreeendl;
cout"Salary: \t\t"salendl;
cout"Joining Date: \t\t"joinDateendl;
cout"Contact Number: \t"cellendl;
cout"Address: \t\t"addressendl;
}
};
main()
{
system("cls");
StaffRegistration emp;
emp.InputStaffData();
cout"---------------------------------------------------------------------------"endl;
cout"\t\t\t\ DISPALAY STAFF INFORMATION"endl;
cout"---------------------------------------------------------------------------"endl;
emp.DisplayStaffData();
cout"---------------------------------------------------------------------------"endl;
system("pause");
}


Post a Comment

 

Top