Partial preview of the text
Download Simple Payroll Program (Java OOP) and more Exams Computer Science in PDF only on Docsity!
PROGRAM:
Task Performance A Simple Payroll Program Objective: At the end of the activity, the students should be able to: = Create a program that exhibits inheritance and polymorphism. Software Requirements: = Latest version of NetBeans IDE = Java Development Kit (JDK) 8 Procedure: 1. Create four (4) Java classes. Name them RunEmplayee, Employee, FullTimeEmployee. PartTimeEmployee. The RunEmployee dass shall contain the main method and will be used to execute the program 2. Wtite a simple payroll program that will display employee's information. Refer to the UML Class Diagram for the names of the variable and method. This should be the sequence of the program ‘upon execution: a. Ask the user to input the name of the employee b. Prompt the user to select between full time and part time by pressing either F (full time) or P (part time). cif F is pressed, ask the user to type his monthly salary. Then, display his name and monthly salary. if Pis pressed, ask the user to type his rate (pay) per hour and the number of hours he worked for the entire month separated by a space. Then, display his name and wage. Employee =_name: String + setName () ‘aid a — FullfimeEmployee PartTime Employee monthlySalary: double ~ ratePerHour. double + setMonthiySalary(): vol + hoursWorked: int + getMonthlySalary(): double = wage: double + setWage(): void + getWage(): double Note: You can add variables and methods if needed. Just make sure that all the variables and methods in the diagram are properly used. ‘Sample Output: Enter nane Veronica V Velasquez Press F for Full Tine or P for Part Tine P Enter rate per hour and no. of hours vorked separated by space Sample: 107.50 13 108.95 72 Name: Veronica V. Velasquez Wage: 7844.40 GRADING RUBRIC (100 points): Criterion Description ‘Max Points Correctness “The code produces the expected result 40 Logic “The code meets the specifications of the problem. 40 Efficiency “The cade is concise without sacrificing comeciness and logic. 10 ‘Syntax “The code adheres to the rules of the programming language. 10