0% found this document useful (0 votes)
541 views

Assignment 8

The document defines two classes - Employee and ProductWorker. Employee has attributes for name and number and methods to get/set those values. ProductWorker inherits from Employee and adds attributes for shift number and hourly pay, with get/set methods. The pseudocode creates an object of ProductWorker, prompts the user to input values, and displays the populated object.

Uploaded by

Andrew Carts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
541 views

Assignment 8

The document defines two classes - Employee and ProductWorker. Employee has attributes for name and number and methods to get/set those values. ProductWorker inherits from Employee and adds attributes for shift number and hourly pay, with get/set methods. The pseudocode creates an object of ProductWorker, prompts the user to input values, and displays the populated object.

Uploaded by

Andrew Carts
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Employee

# EmployeeName: String
# EmployeeNumber: Int

+ getEmployeeName() : String
+ getEmployeeNumber(): Int
+ setEmployeeName(String) : void
+ setEmployeeNumber(String): void

ProductWorker

# ShiftNumber: Int
# HourlyPay: Float

+ getShiftNumber() : Int
+ getHourlyPay(): Float
+ setShift(Int) : void
+ setHourlyPay(Float): void

Pseudocode:
START
Create class Employee():
Define attributes Employee(
EmployeeName
EmployeeNumber)
getEmployeeName
getEmployeeNumber
setEmployeeName
setEmployeeNumber
Create class ProductWorker(Employee):
Define attributes ProductWorker(
ShiftNumber
HourlyPay)
getShiftNumber
getHourlyPay
setShiftNumber
setHourlyPay
Call class ProductWorker()
Create object of class ProductWorker()
While ProductWorker() attributes != 0
Print Message Enter Employee Name:
setEmployeeName
Print Message Enter Employee Number:
setEmployeeNumber
Print Message Ennter Employee Shift:
setShiftNumber
Print Message Enter Hourly Pay:
setHourlyPay
Endwhile
Display object of ProductWorker()
END

START

Create class Employee(EmployeeName,


EmployeeNumber)

Define Methods

Create class ProductWorker(ShiftNumber,


HourlyPay)

Define Methods

Call class ProductWorker()

Create an Object of the


ProductWorker class

While ProductWorker() attributes != 0

Display object of ProductWorker()

Display
Message

Read
EmployeeName

Display
Message

Read
EmployeeNumber

END
Display
Message

Read ShiftNumber

Display
Message

Read HourlyPay

You might also like