Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

need to create a employee class using C++

We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based on the Employee class, along with a class that contains the main method. The attributes, constructors, and methods for this class must satisfy the requirements in Steps 1 through 3. After you create the objects, you will prompt the user for information and then display it.

We will want to ensure that this first class is well-constructed and tested since we will extend this class in Labs 3 through 6.

Deliverables

Due this week:

Capture the Console output window and paste it into a Word document.
Zip the project folder files.
Put the zip file and screen shots (Word document that contains programming code and screen shots of program output) in the Dropbox.
iLAB STEPS
STEP 1: Understand the UML Class Diagram
Back to Top
Use the following UML diagram to build the class. The first section specifies the attributes. The second section specifies the behaviors, and the first character specifies the access modifier value, where:

"-" means that the class member is private, and
"+" means that the class member is public.

STEP 2: Code the Employee Class
Back to Top
Create a new project called "CIS247B_Week2Lab_YourName".
Using the provided Class Diagram from Step 1, code the Employee class in the new project (i.e., "Realize the UML Class diagrams").
The default constructor should set the attributes as follows: firstName = "not given", lastName = "not given", gender = "U" (for unknown), dependents = 0, and annualSalary = 20,000.
The multi-arg constructor should initialize all of the attributes using values passed in using its parameter list.
As shown in the Class diagram, each attribute should have a "getter" to retrieve the stored attribute value, and a "setter" that modifies the value.
The calculatePay( ) method of the Employee class should return the value of annual salary divided by 52 (return annualSalary / 52;).
The displayEmployee() method should display all the attributes of the Employee object in a well-formatted string with logical labels applied to each attribute. Don't forget to call calculatePay from within the displayEmployee method in order to display the Employee's weekly pay as well!
STEP 3: Code the Main Program
Back to Top
In the Main class, create code statements that perform the following operations. Be sure you follow proper commenting and programming styles (header, indentation, line spacing, etc.).

Create an Employee object using the default constructor.
Prompt for and then set the first name, last name, gender, dependents, and annual salary. (Remember that you have to convert gender, dependents, and annual salary from strings to the appropriate data type.)
Using your code from last week, display a divider that contains the string "Employee Information"
Format the currency using the following formatting services:

Display the Employee information.
Create a second Employee object using the multi-argument constructor, setting each of the attributes with appropriate valid values.
Using your code from last week, display a divider that contains the string "Employee Information".
Display the Employee information for the second Employee object.
STEP 4: Compile and Test
Back to Top
When done, compile and run your code.

Then, debug any errors until your code is error-free.

Check your output to ensure that you have the desired output, modify your code as necessary, and rebuild.

STEP 5: Screen Prints
Back to Top
Capture the Console output window and paste into a Word document. The following is a sample screen. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91270179
  • Price:- $50

Guranteed 36 Hours Delivery, In Price:- $50

Have any Question?


Related Questions in Computer Engineering

A supermarket awards coupons depending on how much a

A supermarket awards coupons depending on how much a customer spends on groceries. For example, if you spend $50, you will get a coupon worth eight percent of that amount. The following table shows the percent used to ca ...

Question suppose an algorithm requires cn2nbspoperations

Question : Suppose an algorithm requires cn 2  operations when performed with an input of size n (where c is a constant). a. How many operations will be required when the input size is increased from m to 2m (where m is ...

After reading this weeks materials please respond to two 2

After reading this week's materials, please respond to TWO (2) of the following questions. PROVIDE CITATION IN APA 1. Describe the controls contained within the three Access Control categories that can be integrated with ...

How to response to those 3 following questionsrational

How to response to those 3 following questions Rational Agent ( Artificiall intellegence) 1. There can be more than one agent program that implements a given agent function. (If you agree, provide an example; otherwise a ...

Mark harris just received a cash gift from his grandfather

Mark Harris just received a cash gift from his grandfather. He plans to invest in a five-year bond issued by Cullumber Corp. that pays an annual coupon rate of 4.5 percent. If the current market rate is 7.50 percent, wha ...

Question 1 with the explosion of users on social media

Question: 1. With the explosion of users on social media sites, businesses need to establish their presence on social media sites. Just search for "Vans" or "Starbucks" on Facebook for examples of company sites. To manag ...

Come with an app that only runs in horizontal orientation

Come with an app that only runs in horizontal orientation. It displays "This is fun!" on the top left corner of the screen with no margin either from the top or the left.

A bit-comparator is a combinational circuit with 2 inputs a

A Bit-Comparator is a combinational circuit with 2 inputs, A and B, and 3 outputs. L, E and G. Output L is 1 if A Output E is 1 if A = B, otherwise E is 0. Output G is 1 if A > B, otherwise G is 0. Show how the 2x4 decod ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Provide examples and state precisely the meaning of the following features supported by ...

Question having a strong statistical picture of data is

Question : Having a strong statistical picture of data is important to being able to properly identify trends in statistical analysis. In R, how can an analyst identify appropriate sample distributions and test for norma ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As