Total members 11890 |It is currently Fri Apr 19, 2024 4:25 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





i have assigment in c++ it difficult for me to resolve
a software company owner want to build a system to schedule employee by checking their availability; the time that they come and the time that they leave then compute working hours. also he wants to be able to add new employee or remove another from existing list of employees.

function required
1- class employee
data member should chosen by student himself like name ,id job or any other information

declare more than one object inside main program for each class type


2-class 2: define a class call admin inherited from Employee class

data member should chosen by student himself (take into your consideration the constructor and deconstructor function)

define a member function called ADD to insert new admin information
define a member function called REMOVE to delete special admin

compute Programmers working hours

declare objects from class type (you should declare more object).



class 3: define a class call Programmer inherited from Employee class

data member should chosen by student himself (take into your consideration the constructor and deconstructor function)

define a member function called ADD to insert new programmer information
define a member function called REMOVE to delete special programmer



declare objects from class type (you should declare more object).


remark

all informatin save in array after close program it will be lost not in file.

when user use program there are 3 chioce will show

1-admin

if choose admin will show some option
-insert new admin
-remove admin
-insert employee
-delete employee
-caculate working hours of employee
-return main menu

2- if choose programmer will show some option
-add new programmer
-remove programmer
-check in (time that they come)
-check out(time that they leave

return main menu


3-exit
_____________________________
*all informatiom enter by user.
*program include switch statement to move between option.
*all class declaration put in header file.

i need code before end of 20/6/2009
sorry for disturb
with thanks




Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

which part exactly that you can't do ?


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

Code:
class employee
{
      private:
       struct EmployeeRecord
       {
         string EmpName;
         string EmpDOB;
         string EmpJob;
         int    EmpID;
         double EmpSalary;

       };
      
        EmployeeRecord Emp[100];
      
      public:
                 employee(void);
         void addEmployee(int EmpCounter);
         void deletEmployee(int EmpCounter);
           void showEmployeeRecords(int EmpCounter);    
         

};


employee::employee(void)
   {   }


void employee::addEmployee(int EmpCounter)
{

         cout<<"Enter Employee ID Number:"<<endl;
         cin>>Emp[EmpCounter].EmpID;

         cout<<"Enter Employee Name:"<<endl;
         cin>>Emp[EmpCounter].EmpName;

         cout<<"Enter Employee Birth Day:"<<endl;
         cin>>Emp[EmpCounter].EmpDOB;

         cout<<"Enter Employee job:"<<endl;
         cin>>Emp[EmpCounter].EmpJob;

         cout<<"Enter Employee Salary:"<<endl;
         cin>>Emp[EmpCounter].EmpSalary;
}


void employee::deletEmployee(int EmpCounter)
{
         int RecordNo;
         int DeletedEmpID;
           
         RecordNo=0;
         cout<<"Enter Staff Number:"<<endl;
         cin>>DeletedEmpID;
         for(int i=1;i<=EmpCounter;i++)
            {
               if(Emp[i].EmpID==DeletedEmpID)
               {
                  RecordNo=i;
                  break;
                }
            }
        if (RecordNo==0)
      {
         cout<<"Employee ID is Not Correct!!"<<endl;
      }
      else
      {
         for (int j=DeletedEmpID;j<=EmpCounter;j++)
         {
           Emp[j].EmpID     = Emp[j+1].EmpID;
           Emp[j].EmpName   = Emp[j+1].EmpName;
           Emp[j].EmpJob    = Emp[j+1].EmpJob;
           Emp[j].EmpDOB    = Emp[j+1].EmpDOB;
           Emp[j].EmpSalary = Emp[j+1].EmpSalary;
         }

      }               
}

void employee::showEmployeeRecords(int EmpCounter)
{
  cout <<"Employee Recordes"<<endl;
  cout <<"================================"<<endl;
  for (int j=1;j<=EmpCounter;j++)
  {
    cout <<"Employee ID: "<<Emp[j].EmpID<<endl;
    cout <<"Employee Name: "<<Emp[j].EmpName<<endl;
   cout <<"Employee Job: "<<Emp[j].EmpJob<<endl;
   cout <<"Employee Date of Birth: "<<Emp[j].EmpDOB<<endl;
   cout <<"Employee Salary: "<<Emp[j].EmpSalary<<endl;
    cout <<"================================"<<endl;
  }

}




this is empoyee class but i do not if is correct or not
but how i can do inheritence from it as i explain last time for admin and for programmer, admin make -insert new admin
-remove admin
-insert employee
-delete employee
-caculate working hours of employee
  and programmer
make
add new programmer
-remove programmer
-check in (time that they come employee)
-check out(time that they leave employee)

and how create object in main program

thanks so much for reply
i have just approximetly 12 days to submit project to teacher and i study parttime and i study basic things only
thanks again.



Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

did he told you to do this in c++? or you can use any kind of language..??

i would suggest you another way of doing this project create a menu with the things you need
to put such as delete employer etc cause to create buttons is not an easy thing.. after it make 2 tables one for employes and another for the programmer ..and go it separate ways in the end combine the 2 parts to work properly ..) it s an easy way ...always first make an analisys before you start to write down code ..cause you might find many easy ways to do it..


Author:
Moderator
User avatar Posts: 47
Have thanks: 1 time
Post new topic Reply to topic  [ 4 posts ] 

  Related Posts  to : build a system to schedule employee by checking availability
 code for check availability     -  
 checking if a HTML element is visible or hidden under JQuery     -  
 how to build cell phone app     -  
 Build Calculator in OpenGL     -  
 Creating a Java Application Build using RAD 7     -  
 Build distribution applications by remoting(TCP/HTTP)     -  
 how to build a rating bar in easy and quick way in website     -  
 a moving graph sortof widget build using Swing     -  
 Use two dimensional array to build company sales program     -  
 Build Linear Regression in Python - Supervised Learning     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com