Question
For this assignment, you are tasked with the responsibility of building the framework for the Healthy Pharmacy that we discussed in lab/recitation. The Healthy Pharmacy
For this assignment, you are tasked with the responsibility of building the framework for the Healthy Pharmacy that we discussed in lab/recitation. The Healthy Pharmacy is looking to develop a software application to model their employee hierarchy. Currently the pharmacy has the following types of job titles for their employees: Pharmacist, Pharmacy Manager, Technician, and Senior Technician. Healthy Pharmacy has elected to proceed with an hourly payment schedule for all employees obviously the rates for each job title will vary (e.g., a Pharmacy Manager will make more per hour than a Technician). Every employee will have the following attributes:
Employee ID
First Name
Last Name
Hourly Rate
This program will be written in Java.
Your program will be menu driven in which you will provide the following prompts to the user:
1.Load Employees (From File)
2.Exit Program
Once the user has loaded the employees the following options should be provided:
1.Print Employee Information
2.Enter Hours Worked
3.Calculate Paychecks
4.Exit Program
The text file containing employee data will be provided to you. The filename will be employees.txt this file can be found (and downloaded) on Canvas. The file will contain four (4) employees one in each role.
The following is the hourly rate for each respective job title this is a predefined and set amount:
Pharmacy Manager (ID=1): $50/hour
Pharmacist (ID=2): $40/hour
Technician (ID=3): $20/hour
Senior Technician (ID=4): $25/hour
You are required to implement the following items as part of this assignment:
Your program must contain at least six (6) classes.
Driver
Employee
Pharmacy Manager
Pharmacist
Technician
Senior Technician
You must use the concept of Inheritance to model the relationships between the classes this should be present in your Java code as well as your UML Class Diagram.
You are required to handle all exceptions (I/O). See below:
1. Load Employees (From File)
2. Exit Program
Enter Your Selection: 1
File Load Failed!
java.io.FileNotFoundException: employees.txt (The system cannot find the file specified)
Program Exiting...
You are required to use an Array to store the employees when you load them from the textfile you will use this array to access the individual employees from within the program.
The hours worked (Option #2) is the hours worked for each employee here we assume all employees work the same amount of hours each week.
If the user attempts to print the paychecks (Option #3) prior to entering the amount of hours worked an error message should be displayed. See below:
1. Load Employees (From File)
2. Exit Program
Enter Your Selection: 1
1. Print Employee Information
2. Enter Hours Worked
3. Calculate Paychecks
4. Exit Program
Enter Your Selection: 3
Please enter the hours worked (Option #2) before trying to calculate the paycheck amounts!
Below is the output of what your program should display when executed:
1. Load Employees (From File)
2. Exit Program
Enter Your Selection: 1
File Successfully Loaded!
1. Print Employee Information
2. Enter Hours Worked
3. Calculate Paychecks
4. Exit Program
Enter Your Selection: 1
ID: 90000123 Name: John Jones Rate: 50
ID: 90012342 Name: Crystal Konrad Rate: 40
ID: 90006783 Name: Tim Duncan Rate: 20
ID: 90001234 Name: Brittany Willis Rate: 25
1. Print Employee Information
2. Enter Hours Worked
3. Calculate Paychecks
4. Exit Program
Enter Your Selection: 2
Please enter the hours worked: 40
1. Print Employee Information
2. Enter Hours Worked
3. Calculate Paychecks
4. Exit Program
Enter Your Selection: 3
ID: 90000123 Check Amount: $2000.0
ID: 90012342 Check Amount: $1600.0 ID: 90006783 Check Amount: $800.0
ID: 90001234 Check Amount: $1000.0
1. Print Employee Information
2. Enter Hours Worked
3. Calculate Paychecks
4. Exit Program
Enter Your Selection: 4
Goodbye!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started