Wednesday, 5 August 2015

CS201 4th ASSIGNMENT.

CS201 4th ASSIGNMENT.

#include <iostream>
#include <stdlib.h>
using namespace std;
class StaffRegistration
{
private:
char cnic[18];
char name[30];
char fname[50];
char dob[11];
char degree[10];
char desig[15];
char sal[10];
char joinDate[11];
char cell[13];
char address[40];
public:
void InputStaffData()
{
                //enter your full name//

cout<<"Program developed By: "<<endl;
                //enter your vu id
cout<<"My VU ID : "<<endl;

cout<<"\nPlease enter National Identity Card Number(CNIC)"<<endl;
cin.getline(cnic,18);
cout<<"Please enter name"<<endl;
cin.getline(name,30);
cout<<"Please enter father name"<<endl;
cin.getline(fname,50);
cout<<"Please enter date of birth (dd/mm/yyyy)"<<endl;
cin.getline(dob,11);
cout<<"Please enter qualification"<<endl;
cin.getline(degree,10);
cout << "Please enter designation:" << endl;
cin.getline(desig,15);
cout<<"Please enter salary"<<endl;
cin.getline(sal,10);
cout<<"Please enter joining date (dd/mm/yyyy)"<<endl;
cin.getline(joinDate,11);
cout<<"Please enter contact number"<<endl;
cin.getline(cell,13);
cout<<"Please enter address information"<<endl;
cin.getline(address,40);
cout<<"\nRecord added successfully !!!"<<endl;
}
void DisplayStaffData()
{
cout<<"CNIC: \t\t\t"<<cnic<<endl;
cout<<"Name: \t\t\t"<<name<<endl;
cout<<"Father Name: \t\t"<<fname<<endl;
cout<<"DoB: \t\t\t"<<dob<< endl;
cout<<"Qualification: \t\t"<<degree<<endl;
cout<<"Designation: \t\t"<<desig<<endl;
cout<<"Salary: \t\t"<<sal<<endl;
cout<<"Joining Date: \t\t"<<joinDate<<endl;
cout<<"Contact Number: \t"<<cell<<endl;
cout<<"Address: \t\t"<<address<<endl;
}
};
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");

}

No comments:

Post a Comment