Create a second employee object using the multi-argument

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

iLab 2 of 6: Employee Class

iLAB OVERVIEW

Scenario and Summary

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

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

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

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

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

Capture the Console output window and paste into a Word document. The following is a sample screen.

STEP 6: Submit Deliverables

Capture the Console output window and paste into a Word document.

Put the zip file and screen shots (Word document that contains programming code and screen shots of program output) in the Dropbox.

Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these step-by-step instructions or watch this Tutorial Dropbox Tutorial.

Reference no: EM13760304

Questions Cloud

Evaluate the three methods of analysis : Using your text and at least one scholarly source, prepare a two to three page paper, in APARTMENT format, and evaluate the three methods of analysis: Horizontal, vertical, and ratio as explained in your course textbook.
Balance sheets and income statements : The following balance sheets and income statements are for Net Devices Inc., a manufacturer of small electronic devices, including calculators, personal digital assistants and mp3 players. For purposes of these questions assume that the company ha..
Write a literary essay on wife of baths tale by chaucer : Write a literary essay on: Wife of Bath's Tale by Chaucer (1360): like Lysistrata, here is another pro-feminist story before the word "feminism" existed.
Discuss how these characteristics influence buying decision : How has the Internet affected price considerations? Analyze several different industries, such as airlines, sales, hotel reservations, and book
Create a second employee object using the multi-argument : Create a second Employee object using the multi-argument constructor, setting each of the attributes with appropriate valid values.
Analyze the impact of current trends : Analyze the impact of current trends, such as virtual and cross-cultural teams and technology advancement, on project management.
Organizational report : You have been hired as the CIO of a large multinational Internet advertising company. The president of the company is entertaining a major new software development project to keep track of advertising revenues.
External user of accounting data for xyz company : 1. Which of the following would not be considered an external user of accounting data for XYZ Company?
Health for explanations of these dimensions : Physical health, Social health, Intellectual health, Environmental health, Emotional health, Spiritual health.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement a standard sorted linked list class

Write C++ Program:Implement a standard SORTED linked list class. Be sure to include constructor/copy constructor, destructor, and assignment operator overload.

  Write a statement that assigns the next to last

Assume that the array arr has been declared. In addition, assume that ARR_SIZE has been defined to be an integer that equals the number of elements in arr .

  Draws a single level for a "rogue­like" computer game

You will write a program that draws a single level for a "Rogue­like" computer game. The program will parse a line of input text from an input file (room.txt), use the parsed text to determine the shape of the room and its contents and then draw the ..

  Program that would display a letter to a friend

Writing a c++ program that would display a letter to a friend? It should have a proper format like name, friends name, address.....etc

  Write two short c programs and solve exam-style problem

Write two short C programs and solve four exam-style problems.

  Write a printf or scanf statement

Write a printf or scanf statement for each of the following:a. Print unsigned integer 40000 left justified in a 15-digit field with 8 digits.b. Read a hexadecimal value into variable hex.

  Generate an object-oriented design for a system

Generate an object-oriented design for a system that keeps tracks of your CD and DVD collection. Identify each of the classes, associated data, and operations for the classes.

  Build a basic cipher base class

Build a randomly generated simple substitution cipher and use it to encode messages. Again the encoded messages will be in all upper case letters only.

  Programs written with inheritance

Many programs written with inheritance could be written with composition instead, and vice versa. Rewrite the classes Point3D, Sphere and Cylinder using composition rather than inheritance

  Write a program that tells what coins to give out

Write a program that tells what coins to give out for any amount of change from 1 to 99 cents.

  For this program reads the first 11 characters

E main for this program reads the first 11 characters from input, saving them. It then reads 26 short integers into |vals|, and passes them and the characters to EmbedWatermark, which subtly alters the contents of vals to contain the characters. A..

  Write a program in which the program prints out

Use (switch statement) to write a program in which the program prints out the input (single character) if the character is not '2','t', or 'w'. Use 'default' and 'break' wisely.

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