1. Engineering
  2. Computer Science
  3. i need help with this computer science assignment please...

Question: i need help with this computer science assignment please...

Question details
I need help with this Computer Science assignment please!!!
CSE 205: Object Oriented Programming Assignment 2 Overvievw In this assignment you will write a program that will model a company employee tracking system. You will be able to hire people, change their salaries, work hours per week, and give them paychecks. This will involve multiple classes, an abstract class, and an interface. The ending relationship between your classes will look like: Com 4cabstract>> ccinterface) SoftwareEngineer AdministrativeAssistant Requirements Your program must do the following in order to receive full credit on this assignment. 1. Create an abstract class called Employee Each Employee has a name, salary, and cash. i. Salary and cash should be doubles. a. 2. Write a get for name and cash. 3. Write a method called getPaid in which the Employees cash goes up by one paycheck Employees are paid bi-weekly and salary is annual a. Write a public abstract void method called giveRaise which takes a double for the percentage we want to increase their salary by Create a class called SoftwareEngineer which extends Employee 4. 5. a. Create a constructor which takes a Implement the inherited abstract method giveRaise name and salary. Cash starts at 0 6.
a. Salary should be increased by the percentage given in the parameter 7. 8. Create an Interface called Hourly Provide signatures for the following methods: a. b. c. A public int method which returns the number of hours this person works A public method to change the number of hours that this person works A public void method called giveRaise which takes a double parameter for the amount to increase their hourly pay by 9. Create a class called AdministrativeAssistant which extends Employee and implements Hourly 10. Write a constructor which takes a name, salary, and the hours that this person works per week. a. b. You will need a new instance variable for the hours per week. Salary is how much they are paid per hour 11. Write a get and set for hours per week. 12. Provide an implementation for the conflicting giveRaise a. Unlike the Software Engineers raise, this is a flat increase not a percentage 13. Write an override for getPai a. Hourly workers are paid for the number of hours they have worked the past two weeks 14. Create your main class (called Company in the above picture 15. Write a main menu method which gets the users choice from the following list and verifies they selected a valid option before returning it. a. Add an Employee b. List all Employees c. Give an Employee a raise d. Give Paychecks e. Change someones hours f. Quit 16. Write your main method which will loop through user inputs and process the option they select each time 17. You will need the following arrays: a. An employee array which holds all employees at the company i Maximum of 5 An hourly array which holds a copy of the Employee objects which are also Hourly Note: You may want some other variables to help you manage these. Also, depending on how you set things up, you may not b. c. want to declare these in main. 18. If the user chose to add a new employee, check that theres space for one. If there is, get their name and salary
If there wasnt, print an error At this point check if the new employee is hourly or not. a. b. i. If they are, get the hour they will work c. Add this person to the Employee array i. If they are an hourly worker, add them to that array as well 19. If the user chose to list all the employees, then display the information about each employee Format: Name, Salary, hours (if theyre hourly), and then if theyre a Software Engineer or Administrative Assistant. a. b. See example outputs 20. If they chose to give someone a raise, ask for the name, and then (if that employee exists) ask for how much of a raise and apply it a. If the name doesnt match anybody print an error 21. If they chose to give paychecks, then run getPaid on all Employees. a. If theres nobody, print an error 22. If they want to change someones hours, then get the name of the person and (if that person exists and is an hourly worker) state their current hours and let the user provide a new number of hours per week a. If they dont exist or arent an hourly worker, print an erron b. Hint: Heres where keeping two arrays can save you some headache Example Inputs Below are five example runs of the program with the inputs and outputs. Remember, the graders will be testing your program come up with your own before submitting your program against these as well as their own, so make sure you test these and #1 What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Nobody works here! What do you want to do?
A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Bye! #2 What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit What is their name? Mohammad What is their salary (yearly or hourly)? 500 Are they an hourly worker? (Y/N) Mohammad was hired! What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Mohammad Salary: 500.0 Cash: 0.0 Software Engineer What do you want to do? A. Add an Employee
B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Bye! #3 What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit What is their name? Mohammacd What is their salary (yearly or hourly)? 500 Are they an hourly worker? (YIN) Mohammad was hired! What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Who do you want to give a raise to? Mohammad What raise do you want to give them? 10
Mohammad is happy! What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours uit Mohammad Salary: 550.0 Cash: 0.0 Software Engineer What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Bye! #4 What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit What is their name? Mohammad What is their salary (yearly or hourly)? 500 Are they an hourly worker? (Y/N) Mohammad was hired!
What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Hooray for money! What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Mohammad Salary: 500.0 Cash: 19.23076923076923 Software Engineer What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Bye #5 What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit
What is their name? Mohammad What is their salary (yearly or hourly)? 500 Are they an hourly worker? (Y/N) How many hours per week do they work? 20 Mohammad was hired! What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Mohammad Hourly Wage: 500.0 Cash: 0.0 Adminstrative Assistant What do you want to do? A. Add an Employee B. List al Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Invalid option Change hours for who? Mohammad Mohammad currently works 20 hours per week. What would you like to change it to? 40 Mohammad will now work 40 hours per week What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks
E. Change someones hours F. Quit Mohammad Hourly Wage: 500.0 Cash: 0.0 Adminstrative Assistant What do you want to do? A. Add an Employee B. List all Employees C. Give an Employee a Raise D. Give Paychecks E. Change someones hours F. Quit Bye Submission Please submit your Assignment2.java file to the Assignment 2 link on Canvas under the Assignments section. You may submit as many times as you want prior to the due date, in case you later find and fix an error, but only the last one is graded.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution