Your system gets a list of workers and displays information about each worker. Every 3 workers, your reporting
system inserts a page number. It also starts with a nice title. Let's name the reporting system ReportWriter. To focus
on the topic covered by the course, we do not use any physical printer. Just output the text in a file.
The information printed about workers depend on the kind of workers. A worker can either be:
employee
sub-contractor
student (temporarily at the company to learn)
For employees, your system display their monthly salary, and amount of remaining holiday for the current year. For
sub-contractor, you display the daily rate. For students, you display the name of the school they belong to. For all
workers, your display the first and last name.
Great Report
------------
Bill Gates
€1000/month, 20 days
Bruce Lee
Shaolin School
Barak Obama
€59/day
page 1
John Rizzo
BlackBelt University
page 2
1. Draw the class diagram corresponding to this problem.
2. Code these classes in Java
3. Write a Main class with a main method to test your system. Feed the ReportWriter with a list containing 6
workers with at least one of each type (employee, sub-contractor, student).
Partager