Investigation of object-oriented programming by creating

Assignment Help Basic Computer Science
Reference no: EM13730807

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. 

Reference no: EM13730807

Questions Cloud

Workplace situations involving religion : In this module you have learned a lot about religion, and have attempted to respond to some workplace situations involving religion. It is important to ensure that managers are aware of what the definition of "religion" is and what it means in the..
Need a flow chart /blue print showing all the steps : Need a flow chart /blue print showing all the steps below is in the process - ordering a drink at our large pools 1. customer wants drink
Case study on balancing priorities at clif bar : Case Study on Balancing Priorities at Clif Bar, Without knowing Gary Erickson's age, where would you guess he falls in the four generations of workers as delineated by Zemke
Case study-training assessment : Training assessment is an important task for HR personnel. Use the Argosy University online library and textbooks to read about training assessments.
Investigation of object-oriented programming by creating : 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, ..
What was the initial impression : Marketing Assignment: Observational research project- site visit and report on a non hospital health service facility, what was the initial impression
What should be ranyards current stock price : Ranyard's beta is 1.13, and the last dividend per share paid was $4.21. The market risk premium is estimated to be 7.56%, and the real rate of interest is 2.04%. The liquidity risk premium is 0.7%. Analysts expect the company to grow at a rate of 3.5..
What is its coefficient of variation : Stock X has an expected return of 0.08. It has a beta estimated at 1, a risk-free rate of 0.03 and a risk premium of 6.4. Its variance of returns is 0.0029. All returns here are expressed as decimals, not percentages. What is its coefficient of varia..
What are the lessons to be learned from each crisis : Discussion-Global Stock Market and Exchange Rate Fluctuations, What are the lessons to be learned from each crisis

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Consider a variant of cbc-mode encryption

Consider a variant of CBC-mode encryption where the sender simply increments the IV by 1 each time a message is encrypted (rather than choosing IV at random each time). Show that the resulting scheme is not CPA-secure.

  Computing downtime in telephone per year

Telephone system has an availability of 99.999 percent. How much downtime is that per year? Express your answer in a way that is easy for someone to understand.

  Importance of creating an order of volatility

Develop a detailed plan to approach and secure the incident scene based on the information you have from the scenario - Discuss the initial steps you would take for the investigation

  Describe how the deadlocks can be resolved

give at least two real life examples ( not related to a computer system invironment) of each of these concepts:deadlock, starvation, and race. describe how the deadlocks can be resolved.

  Estimate maximum aggregate i-o transfer rate in system

Estimate the maximum aggregate I/O transfer rate in this system. Hint: Only one device at a time can be serviced on a selector channel.

  Find a simplified expression for function

find a simplified expression for F = A?BC?D + A?B?D + A?CD + ABD + ABC - Assuming that the inputs ABCD = 0101, BCD = 1001, ABCD = 1011 never occur,

  Systems development quality and use case

SYSTEMS DEVELOPMENT QUALITY AND USE CASES:The purpose of SLP 5 is to get acquainted with a third modeling technique and use the output model to document the system and train users. Structure process and data models were introduced in previous modules..

  Compare and contrast roles and responsibilities it positions

Compare and contrast the roles and responsibilities of IT position.

  Discussion question arrays

Discussion question Arrays

  Design a program that will allow a user to input a list

Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who lives in Texas

  Concept and include strengths and weaknesses of papers

Analyse those papers and make a document with usual report format such like Abstract, Introduction, body, conclusion and references and also appendix.

  Write program calculates and prints the average several int

Write a program that calculates and prints the average of several integers. Assume the last value read with scanf is the sentinel 9999

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