Write a class named employee with the class declaration

Assignment Help C/C++ Programming
Reference no: EM131674165

Assignment

Write a class named Employee, with the class declaration in a file called Employee.h and the implementation in a file called Employee.cpp. The class should have the following data members:

• name - A string that holds the employee's name
• idNumber - An int variable that holds the employee's ID number
• department - a string that holds the name of the department where the employee works
• position - A string that holds the employee's job status

The class must have the following constructors:

• A constructor that accepts the following values as arguments and assigns them to the appropriate number variables: employee's name, employee's ID number, department and position.

• A constructor that accepts the following values as arguments and assigns them to the appropriate member variable: employee's name, employee's ID number. The department and position fields should be assigned an empty string (" ").

A default constructor that assigns empty string ("") to the name, department and position member variables and 0 to the idNumber member variable.

Write the appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables. Once you have written the class, write a separate program that creates 3 instances of the Employee class. Each instance of the class should use a different constructor than the other 2 objects (so all three constructors must be used). Main should use a function called displayEmployee that has one parameter which is a pointer to a constant Employee object.

Main will call the function 3 times to display the information for each of the 3 instances of the Employee class.

void displayEmployee(Employee* const e);

The output of the program must be in the form of a table.

Reference no: EM131674165

Questions Cloud

Describe ethnocentrism : Discuss specifically what you learned about yourself in the process of doing the implicit preference tests. Describe ethnocentrism.
Difference between a one-way design and a two-way design : What is the difference between a one-way design and a two-way design? Suppose you construct a table with cells, rows, and columns to summarize each factor.
How many cells or groups are in the given study : A researcher conducts a 3 x 3 between-subjects ANOVA with 15 participants assigned to each cell or group.
State assumptions for the two-way between-subjects anova : Which source of variation is placed in the denominator of the test statistic for each hypothesis test for the two-way between-subjects ANOVA?
Write a class named employee with the class declaration : Write a class named Employee, with the class declaration in a file called Employee.h and the implementation in a file called Employee.cpp.
What is the biggest upset in the history of woman softball : what is the biggest upset in the history of woman softball?
Which significant effect researcher typically analyze first : A researcher obtains a significant interaction and a significant main effect. Which significant effect should the researcher typically analyze first? Explain.
What would be the 3 rules you would have for your team : if you were a coach, what would be the 3 rules you would have for your team?
Write a program that demonstrates the circle class : Write a program that demonstrates the Circle class by asking the user for the circle's radius and creating a Circle object and then reporting the circle's area.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Build a definition for a class that stores data

Using C++ language, build a definition for a class that stores data about a two dimensional vector. The class has to have mutators and accessors to get and set the x and y values. Make x and y integers. Then overload the operator * so that it retu..

  Prepare a simple game of blackjack using object oriented

prepare a simple game of blackjack using object oriented programming.uml class diagramsyour project must implement the

  What is the total number of handshakes

There are n people in a room, where n is an integer greater than or equal to 1. Each person shakes hands once with every other person.

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Saddle point is an element

For a square nXn a array, a saddle point is an element that is the maximum in its row and the minimum in its column.

  From the worker''s gross pay

An employee is paid at a rate of $16.78 per hour for the first 40 hours worked in a week. Any hours over the regular 40 hours are paid at the overtime rate of one-and-one-half times that. From the worker's gross pay

  The access attributes, list and describe

Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is?

  Write a program that reads full names one per line

Write a program that reads full names, one per line, and then prints them in the standard telephone directory format. For example, the input Johann Sebastian Bach George Frederic Handel Carl Phillipp Emanuel Bach Joseph Haydn.

  Write a function called distance

Write a function called distance that takes two Points as arguments and returns the distance between them.

  Write a program that reads in babynames

Write a program that reads in babynames.txt and produces two files - Separate the data for the boys and girls. You may enter any names

  Display an error message and prompt the user again

Write an application that creates a quiz, which contains at least 5 questions about a hobby, popular music, astronomy, or any other personal interest.

  How many whole numbers they wish to enter

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd