

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


In this exercise session, you will use data and the program created in exercise session II. The Database of employees in FooCorporation has to be created. The database has to contain 2 types of employees: Employee and Manager.
Exercise instructions:
Professional level Base Pay Hours Worked
Employee John B $8.50 35
Employee Graham B $9.00 37
Employee Annabel A $9.20 43
Employee Margaret B $7.80 45
Professional level Base Pay Hours Worked Office number
Manager Bill A $15.00 49 A
Manager Gregory A $16.50 47 A
import java.util.*;
public class FooCorporation {
public static void main(String[] args) { // Define parameters of employees given in the table ( define array list ) employeeList; for ( ) { // Create an object for each employee with relevant parameters employeeList.add(newEmployee); } for () { // Use enhance looping System. out .println("The employee name is " + employee.name + "\n"); // Compute salary and define a working place for each employee } } }
public class Employee { // Store the class in separate file // Create a constructor for the class with 2 methods: salary, office }
public class Manager extends Employee { // Create a constructor for the class with a method hasOffice }