• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Oop project report using c++
 

Oop project report using c++

on

  • 5,493 views

This is Object oriented project report and and the Codes in which you can run on any compiler that support object oriented programming i.e Dev C++.

This is Object oriented project report and and the Codes in which you can run on any compiler that support object oriented programming i.e Dev C++.

Statistics

Views

Total Views
5,493
Views on SlideShare
5,492
Embed Views
1

Actions

Likes
3
Downloads
86
Comments
2

1 Embed 1

http://www.slashdocs.com 1

Accessibility

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Oop project report using c++ Oop project report using c++ Document Transcript

    • PROBLEM OVERVIEW.Summary of a problem:ICT company has for Departments which are FINANCE , TECHNICALOPERATION , HUMAN RESOURCE AND MARKETING and It has total of 500employees.It has two type of employees who are TEMPORARY and PERMANENT , it take atmost 100 temporary employee and at most 400 permanent employee.For TEMPORARY STAFF each department is paid an hourly rate salary of $5 forworking 8 hours/day, 24 days in a month. Annual increment of $0.5/hour is offered toeach temporary staff.  $ 5 per hour for 8 hours/day in 24 days of a month. Monthly income without annual increment is given as: $ 5 * 8 hours * 24 days = $ 960.  Monthly income with annual increment is given as: ($ 5 * 8 hours * $ 0.5 * 24 days )+ $ 960 = $ 1440.  Annual income with annual increment is given as: $ 1440 * 12 months = $4 17,280.Therefore: Total monthly income of the Temporary Staff is $ 1440. Total Annual Income of a Temporary staff is : $ 17,280.For PERMANENT STAFF each department is paid a monthly initial salary of $1500with a 5% annual increment of the basic initial salary. The company has a policy ofawarding each permanent staff a yearly bonus of 10% of the annual salary.  Initial salary : $ 1500 5% annual increment (each month of all 12 month in a year) =( 5/100) * $ 1500 = $ 75 So monthly income with annual increment is given as: $ 1500 + $ 75 $ 1575.  There fore monthly income with annual increment is $1575. 1
    •  Annual salary income of monthly income without annual increment is given as: $ 1500 * 12 months = $ 18,000  Annual salary income of monthly income with annual increment is given as: $ 1575 * 12 months = $ 18,900. Bonus (10% of annual salary)= (10/100) * $ 18,000. =$ 1,800. Annual income with all increment and bonus is given as: TOTAL INCOME = $ 18,900 + $ 1,800. =$ 20,700.Therefore: Total monthly income of a Permanent Staff is $ 1575. Total Annual income of the Permanent Staff is $ 20,700.REQUIREMENT IDENTIFICATION:System to keep Employee’s data including ID number, department name and numberof years a staff has served the company to date (years of service).Also be able to display ID number, department name, years of service, the currentmonthly salary and the annual income of the current year (including bonuses) for eachstaff. Summary structure of ICT Company.KEY: 2
    • HR = HUMAN RESOURCE. TECHN.OP = TECHNICAL OPERATION. DESIGNING.In the Designing , we will consider three Classes which will be DEPARTMENT ,TEMPORARY STAFF AND PERMANENT STAFF. This because in eachdepartment name we will find temporary and permanent employees.Since within Department we will find both temporary and permanent staff thenDEPARTMENT class will be Super Class and TEMPORARY STAFF,PERMANENTSTAFF will be Sub classes that will inherit from DEPARTMENT class. Logical Design of Classes.IDENTIFYING OBJECTS , ATTRIBUTES AND METHODS USED IN CLASSDECLARATION.Object name: DepartmentAtributes:string department_name;string employ_type;string employ_id;int year;Method:void set_data (string e_type,string e_id,string dname,int yr){ department_name=dname; employ_id=e_id; 3
    • employ_type=e_type; year=yr; } string get_department_name(){ return department_name; } int get_year(){ return year; } string get_employ_type(){ return employ_type; } string get_employ_id (){ return employ_id; }Object name: Temporary_staff:public DepartmentMethods:float get_monthly () {return (1440);}float get_annual (){return (17280);}Object name: Permanent_staff:public Department 4
    • Methods:float get_monthly (){return (1575);} float get_annual (){ return (20700);} Algorithm used to design a system.1.Option:1- to Add new employee, 2- to view saved employee, 0-To exit.2.receive option, if option is 1 go step 3,Else if 2 go step 23,else if 0 go step 27,elsedisplay Error!enter correct choice; go step 13.Please enter current year:4.receive and save current year.5.please provide number of employee to be added:6.receive number_to_add,7.if number > 500 go next else go step 9 ;8.number=0; display error! Employee must be less than 501;go step 59.Display Menu for further option : : T- for Temporary employee type, P-for permanent employee. :1-for Finance department, 2- for Marketing department :3-for Human resource, 4- for technical operation10.open loop for i<=number_to_add ; i++ {11.Enter employee type:12.receive type13.Enter employee id 5
    • 14.receive employee id15.Enter year employee admitted/employed to a company;16.receive year , if year<=current year go step 18 else go next17.year=0,display Error!it is out of current year ; go step 1518.Enter Department number as menu above shown;19.receive department number, if department number is not equivalent to 1 to 4 gonext, else go step 2120.display Error!No that department in ICT; go step 1821.Saving data supplied22.end loop23.for(j=0; j<=number;j++){24.receiving saved data25.displaying saved data26.}end loop27.exit Codes used to desing phase that interact with the user as Algorithm statedint main (){ //instace declaration of declared classes;Temporary_staff temp[100]; Permanent_staff perm[400];string e_type ,e_id , dname,type,table_title[5];int yr,choice,number=0,new_number=0,i,v,b,named,current_year=2011; //i,v,bused by for //loops and choice used by while and other as a variablechoice=1; //variable new_number temporary storehistory of added staff numberwhile(choice!=0){ //when user chose to add again new staff,itused to display //all histry from the loop 6
    • cout<<"1- TO ADD NEW EMPLOYEE(S):"<<endl; //creating menu foruser interaction;cout<<"2- TO VIEW AVAILABLE EMPLOYEE(S):"<<endl;cout<<"0- TO EXIT:"<<endl; cin>>choice;if (choice==1){cout<<"PLEASE ENTER CURRENT YEAR:";cin>>current_year;cout<<endl;cout<<"PLEASE PROVIDE NUMBER OF EMPLOYEE YOU WANT TO ADD:";cin>>number; if (number>500 || number ==0){ //CHECK USER INPUTS IF WANT TO ADD1<=STAFF<=500;cout<<"ERROR! MAXIMUM 500 STAFFS OR MINIMUM 1STAFF:"<<"REPEATE AGAIN:";cin>>choice;cout<<endl;}cout<<"--------------------------HEAD-----------------------------.n";cout<<"P- FOR PERMANENT STAFF , T- FOR TEMPORARY STAFF:"<<endl;cout<<"1- FOR FINANCE DEPARTMENT: , 2- FOR MARKETINGDEPARTMENT:"<<endl;cout<<"3- FOR TECHNICAL OPERATION DEPARTMENT , 4- FOR HRDEPARTMENT:"<<endl;cout<<"n";new_number=new_number+number;for (i=1;i<=number;i++){cout<<"*********************"<<endl;cout<<" EMPLOYEE:"<<" "<<i<<endl;cout<<"*********************"<<endl; 7
    • cout<<"ENTER EMPLOYEE TYPE (eg:T for temporary):"<<" ";cin>>type;cout<<endl;cout<<"EMPLOYEE ID (eg:bcs/10/51752):"<<" ";cin>>e_id;cout<<endl;cout<<"YEAR EMPLOYED:"<<" ";cin>>yr;cout<<endl;cout<<"DEPARTMENT NUMBER:"<<" ";cin>>named;cout<<endl;switch (named){case 1:dname="FINANCE.";if (type=="T" || type=="t"){ //asigning Department names according e_type="TEMPORARY:"; //to their number inputed by user with type oftemp[i].set_data(e_type,e_id,dname,yr); //inputed employee} if (type=="P" || type=="p"){e_type="PERMANENT:";perm[i].set_data (e_type,e_id,dname,yr);break;}case 2:dname="MARKETING.";if (type=="T" || type=="t"){e_type="TEMPORARY:";temp[i].set_data(e_type,e_id,dname,yr); } 8
    • if (type=="P" || type=="p"){e_type="PERMANENT:";perm[i].set_data (e_type,e_id,dname,yr);break;}case 3:dname="TECHNICAL OPERATION.";if (type=="T" || type=="t"){e_type="TEMPORARY:";temp[i].set_data(e_type,e_id,dname,yr); }if (type=="P" || type=="p"){e_type="PERMANENT:";perm[i].set_data (e_type,e_id,dname,yr);break;}case 4:dname="HUMAN RESOURCE.";if (type=="T" || type=="t"){e_type="TEMPORARY:";temp[i].set_data(e_type,e_id,dname,yr);}if (type=="P" || type=="p"){e_type="PERMANENT:";perm[i].set_data (e_type,e_id,dname,yr);break; 9
    • }}}}//TO DISPLAY SAVED RECORDS OF BOTH PERMANENT AND TEMPORARYSTAFF; if (choice==2){cout<<"______________________________________________________________n"; cout<<"TEMPORARY STAFF RECORDS:n";cout<<"______________________________________________________________n";for(v=1;v<=new_number;v++){cout<<" "<<"RECORD NUMBER:"<<v<<endl<<endl;cout<<":EMPLOYEE ID:"<<temp[v].get_employ_id()<<endl;cout<<":DEPARTMENT NAME:"<<temp[v].get_department_name()<<endl;cout<<":MONTHLY SALARY($):"<<temp[v].get_monthly()<<endl;cout<<":ANUAL SALARY($):"<<temp[v].get_annual()<<endl;cout<<":YEARS OF SERVICE:"<<current_year-temp[v].get_year()<<endl;cout<<":EMPLOYEE TYPE:"<<temp[v].get_employ_type()<<endl;cout<<"--------------------------------------------------------------n";}cout<<endl;cout<<"______________________________________________________________n"; cout<<"PERMANENT STAFF RECORDS:n";cout<<"______________________________________________________________n";for (b=1;b<=new_number;b++){cout<<" "<<"RECORD NUMBER:"<<v<<endl<<endl; 10
    • cout<<":EMPLOYEE ID:"<<perm[b].get_employ_id()<<endl;cout<<":DEPARTMENT NAME:"<<perm[b].get_department_name()<<endl;cout<<":MONTHLY SALARY($):"<<perm[b].get_monthly()<<endl;cout<<":ANUAL SALARY($):"<<perm[b].get_annual()<<endl;cout<<":YEARS OF SERVICE:"<<current_year-perm[b].get_year()<<endl;cout<<":EMPLOYEE TYPE:"<<perm[v].get_employ_type()<<endl;cout<<"--------------------------------------------------------------n"; }}}system ("pause");return 0;} Concepts used to write a program. 1) Inheritance, for example temporary stuff 2) Arrays , for example to save data entered array used 3) Conditional statements such as If statements and switch statements 4) Loops , for example of loop used are for loops and while loop 11