Create abstract employee class and two pure virtual function

Assignment Help JAVA Programming
Reference no: EM131272208

We are going to create an abstract Employee class and two pure virtual functions calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee, however, a pointer can still be created. Objects based on Salaried and Hourly will be allowed. The pure virtual function calculatePay() in Employee will force the child classes to implement calculatePay(). The other pure virtual function displayEmployee() in Employee will force the child classes to implement displayEmployee().

We are going to implement Polymorphism and dynamic binding in this iLab.

Deliverables

Due this week:

Capture the Console output window and paste it into a Word document.
Zip the project folder in the Microsoft Visual Studio.
Put the zip file and screenshots (word document) in the Dropbox.
iLAB STEPS

STEP 1: Understand the UML Diagram

Back to Top

Notice in the updated UML diagram that the Employee class is designated as abstract by having the class name Employee italicized. Also, the calculatePay method is italicized, which means that it is a pure virtual function and needs to be implemented in the derived classes. In addition, make displayEmployee() method a pure virtual function as well.

STEP 2: Create the Project

Back to Top

Create a new project and name it CIS247C_WK6_Lab_LASTNAME. Copy all the source files from the Week 5 project into the Week 6 project.
Before you move on to the next step, build and execute the Week 6 project.

STEP 3: Modify the Employee Class

Back to Top

Define calculatePay() as a pure virtual function.

Define displayEmployee() as a pure virtual function.

When class Employee contains two pure virtual functions, it becomes an abstract class.

STEP 4: Create Generalized Input Methods

Back to Top

Reuse method getInput() from the previous iLab to prompt the user to enter Employee information.

STEP 5: Modify the Main Method

Back to Top

Create two employee pointers with:

The first employee pointer refers to a salaried employee and the second employee pointer refers to a hourly employee.

Prompt the user to enter information for these two pointers and display the calculated result.

For salaried employee, the following information needs to be displayed:

Partial Sample Output:

For hourly employee, the following information needs to be displayed:

Partial Sample Output:

STEP 6: 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.

Below is a complete sample program output for your reference.

Reference no: EM131272208

Questions Cloud

Explain the usefulness of perceptual mapping : Explain the usefulness (or not) of perceptual mapping in planning a programme such as that described in the Audi case.
Pursuit of a new system until an it strategic plan : Would you suspend both organizations' pursuit of a new system until an IT strategic plan for the merged organization has been developed? Why?
General-purpose equipment?-flexible manufacturing system : Borges Machine? Shop, Inc., has a? 1-year contract for the production of 250,000 gear housings for a new? off-road vehicle. Owner Luis Borges hopes the contract will be extended and the volume increased next year. Borges has developed costs for three..
Describe the disaster plan you would set up for the bank : Describe the disaster plan you would set up for the bank. Make sure you justify the disaster plan chosen and include key metrics such as allowed down time and the amount of time to get services up and running.
Create abstract employee class and two pure virtual function : We are going to create an abstract Employee class and two pure virtual functions calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee
Examine the concept of employment at will : Examine the concept of "employment at will" and the public policy exceptions to it. How does it fit with the issue of "wrongful discharge?"
Relationship between ethics and the law : Look at the relationship between ethics and the law and suggest why some companies opt to behave illegally and what may lead them to engage in illegal activities.
How black slaves used literature or the visual arts : In 125 words, describe two (2) examples of how black slaves used literature or the visual arts as a form of protest against slavery. Compare this to a modern example of art used for social protest.
Simulate a good old game of rock paper and scissors : You are to complete the code found in Player.java. Once completed you can then simulate a good old game of Rock, Paper, Scissors. To play you need to compile Player.java, InputMaker.java, and RockPaperScissorsTest.java.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a method to get list of all the books

Make a map for a book with Book ISBN as key and book title as value - Write a method to get list of all the books in JSON format using restul client.

  Java program to determine roots of a quadratic equation

Write a java program to determine roots of a quadratic equation, the program should use GUI to display the output, either complex or simple roots.

  Explain java-oriented microprocessors presented by sun

Research the latest Java-oriented microprocessors presented by Sun. In what ways are they optimized to implement Java programs?

  The objective is to implement a menu-based system for bank

the objective is to implement a menu-based system for bank accounts in order to simulate a very simple banking system.

  Write java statements that use a for each loop to cycle

Write java statements that use a for each loop to cycle through all the elements in an ArrayList of doubles named grades.

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  Method that receives an array and returns with no duplicate

Write a program that contrains a method that receives an array and returns a new array with no duplicates.

  Create wheel 360 degree

You have to create wheel, 360 degree. That is numbered 0-36. it is supposed to be spun, and randomly lands on one of the numbers.

  Write a java code to count number of capital letters in line

Write a java codenpseudo-code to count the number of capital letters in a line of text. How many comparisons does it do? What is the fewestnumber of increments it might do? What is the largest number?

  This is a simulation of rolling dice actual results

this is a simulation of rolling dice. actual results approach theory only when the sample size is large. so we will

  Write a method called makerow

Write a method called makeRow that is passed two arguments: an int and a String. It returns a String containing n copies of s, concatenated in a row.

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the account number and balance for N bank customers.

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