Demonstrate your object-oriented programming skills

Assignment Help JAVA Programming
Reference no: EM131114335

Assignment will require you to demonstrate your object-oriented programming skills by creating a program involving multiple classes.

The assignment task consists of implementing a tool which would assist the manager of a small company in scheduling employees.

Assessment Details

The assignment task consists of implementing a tool which would assist the manager of a small company in scheduling employees. The details of the company's operations are as follows:

- It operates on 5 days of the week (not on the weekends). On each day the company runs four shifts, and a single employee is required for each shift.
- The company employs both permanent employees and casual employees.
- Permanent employees are allocated to the same shift for all 5 days of a week, and are paid a fixed weekly wage.
- Casual employees can be allocated to any number of shifts per week (including zero), and are paid a fixed amount per shift worked.

The Employee Class
The first stage in this assignment is to define a Java class for an Employee based on the UML diagram on the next page. The methods of Employee should perform as follows:
- The constructor simply initialises the instance variables to the values provided as parameters, and sets shiftsWorkedThisWeek to 0
- The accessor methods (gets) simply return the value of their corresponding variable
- There are no set methods - it is assumed that the employee's name and ID will not change
- resetShiftsWorkedThisWeek() sets shiftsWorkedThisWeek to 0
- incrementShiftsWorkedThisWeek () adds one on to the current value of shiftsWorkedThisWeek
- calculateWeeklyPay() is provided so that it can be over-ridden by the subclasses - this method can be declared as abstract
- the toString method returns a String describing the Employee
o this should be formatted as their employee ID in square brackets, followed by their last name in all upper-case, a comma, and their first-name in mixed-case
o for example, if we have instantiated an Employee as follows
Employee e = new Employee("Joe","Bloggs","BLO12345678");
then calling e.toString should return the String "[BLO12345678] BLOGGS, Joe"
You should also write a small driver class called TestEmployee, and thoroughly test the Employee class before proceeding further.

The PermanentEmployee and CasualEmployee classes

You will also need to create two subclasses of Employee called PermanentEmployee and CasualEmployee. These will inherit from and extend the Employee class as shown in the following UML diagram (refer to Week 10's material on inheritance to see how to implement this):

Each of these subclasses should provide two constructors. One takes four parameters, with the last being the weekly wage (for PermanentEmployees) or the per-shift payment rate (for CasualEmployees). The second constructor for each subclass omits this fourth parameter - in this case the payment-related variable should be a set to a default value. For PermanentEmployees the default weekly wage is $812.47, while for CasualEmployees the default payment per shift is $47.50.

Each subclass also needs to provide its own implementation of the getWeeklyWage() method. For the PermanentEmployee class this can just return the employee's weekly wage, while for the CasualEmployee class it should return the product of the number of shifts worked and the rate of payment per shift.

Once you have implemented these subclasses, you should extend the TestEmployee driver code to instantiate several examples of these classes and call their method to ensure that they are working correctly.

The EmployeeDriverSystem

The final component of the scheduling software system is the EmployeeDriverSystem. This should have a main() method, and will implement a text-driven menu to allow the company manager to work with this week's schedule.

This driver program will be based on two array data-structures (see Week 7 for coverage of arrays):
- The first is a 1-dimensional array which will store a list of all of the company's Employees
- The second is a 2-dimensional array which will store the week's schedule. Each element in this array corresponds to a specific day (the first index) and shift (the second index), and it stores a reference to an Employee object. If an element contains the value null, this indicates that no Employee has been allocated to that specific day and shift yet.
When the program first starts these array data-structures should be created to the required size. The program should instantiate multiple Employees and store them in the employee list array. The employees should have the following characteristics:

- There should be 3 permanent employees and 7 casual employees.
- You should use both the 3 and 4 parameter variants of the constructors for the PermanentEmployee and CasualEmployee classes (i.e. some employees will have the default pay-rates, while others may have higher or lower pay-rates)
- You can make up the names and ID codes for all of the employees, with the exception that the first employee should use your names, and their ID code should consist of the first three letters of your surname followed by the 8 digits of your FedUni student number.
- The data for these Employees can be stored directly in your code.
Once the arrays have been created, the program should display the following text menu to the user. The user should be able to repeatedly select operations from this menu, until they choose to exit the program. You should validate the values entered by the user and print an error message and prompt them to try again if they enter an invalid value:

MENU
1. Display all staff
2. Clear schedule
3. Display schedule
4. Assign shift to casual employee
5. Assign shifts to permanent employee
6. Calculate total weekly wages
7. Exit program Enter your selection:

The menu commands should operate as follows:

- Display all staff
o Displays a list of all the company employees (the order is not important) - see sample output at the end of this document for the required format

- Clear schedule
o Sets all entries in the schedule to null, and all employees shifts worked to zero

- Display schedule
o Displays the current schedule, with one row per day (labelled with the day's name or abbreviation) and the 4 shifts displayed in columns. Unallocated shifts should be indicated by dashes. For allocated shifts the details of the allocated employee should be displayed. Refer to the sample output at the end of this document for an example.

- Assign shift to casual employee

o Prompt the user to enter both a day of the week and a shift number (these values should be tested to make sure they are in range, and the user prompted to re-enter them if they are invalid)
o Once a valid day and shift number have been entered, check to see if that shift has already been allocated. If so, then the program should display an appropriate message and return to the menu.
o If the selected shift is not allocated, the program should display a list of all casual employees (permanent employees should not be listed)
 Hint: you can use Java's instanceof operator to check if an Employee is casual or permanent
o The user should be prompted to select an employee by entering their ID as a String
o When the ID is entered, the program should test if it matches the ID of a casual employee
o If it does, that Employee should be allocated to this shift and their shifts worked should be incremented
o If the ID doesn't match (or if it matches a permanent employee) the program should display an error message and ask the user to enter a new ID - repeat this until a valid ID is entered

- Assign shift to permanent employee
o Prompt the user to enter a shift number (this value should be tested to make sure it is in range, and the user prompted to re-enter it if it is invalid)
o Check to see if this shift is unallocated for all 5 days of the week - if any day already has this shift allocated the program should display an appropriate message and return to the menu.
o If the selected shift number is available on all days, then the program should display a list of all permanent employees (casual employees should not be listed)
 Hint: you can use Java's instanceof operator to check if an Employee is casual or permanent
o The user should be prompted to select an employee by entering their ID as a String
o When the ID is entered, the program should test if it matches the ID of a permanent employee
o If it does, that Employee should be allocated to this shift number for all 5 days and their shifts worked should be incremented by 5
o If the ID doesn't match (or if it matches a casual employee) the program should display an error message and ask the user to enter a new ID - repeat this until a valid ID is entered

- Calculate total weekly wages
o The program should list the details of all employees along with their calculated pay for this week based on the current schedule (see the printout at the back of this document for an example of the layout required)
o The program should also total the pay across all employees and display this at the bottom of the list

- Exit program
o The program should exit the menu loop, displaying a farewell message to the user.

Important note: While the full version of the system will require you to have implemented the CasualEmployee and PermanentEmployee classes, you can begin implementation of the menu and some of the functionality using just the Employee class. As we will not cover inheritance until Week 10, it is important that you start earlier on the other aspects of the assignment to avoid having to implement too much in the last week.

File handling
If you have all of the other program functionality working, a small number of marks are available for performing the initialisation of the Employee array by loading the data from a text-file. We will not cover file-handling until Week 10, so this should be the last feature which you add to your program.

Testing
You should be testing your program as each stage is completed, and again once the program is complete. As well as your program code, you must submit a document detailing the testing which you have performed on your program. This should be formatted according to the University's guidelines for academic work. This should detail the input data given to the program, why that particular data was chosen, and the expected and actual output from the program.
Your testing should be thorough. Your mark for this section will reflect the thoroughness of your testing and the quality of your documentation.

Your assignment should be completed according to the General Guidelines for Presentation of Academic Work.
The following criteria will be used when marking your assignment:
- successful completion of the required tasks
- quality of code that adheres to the programming standards for the course including:
- comments and documentation
- code layout
- meaningful variable names
- use of constants

You are required to provide documentation, contained in an appropriate file, which includes:
- a front page - indicating your name, a statement of what has been completed and acknowledgement of the names of all people (including other students and people outside of the university) who have assisted you and details on what parts of the assignment that they have assisted you with
- details of test data and evidence that the testing was conducted
- list of references used (APA style); please specify if none have been used.

Attachment:- Assignment speci.rar

Reference no: EM131114335

Questions Cloud

Straight-line depreciation and macrs depreciation : Compare and contrast straight-line depreciation and MACRS depreciation. Given the choice, would a firm prefer to use straight-line depreciation or MACRS depreciation? Why?
Describe skills a leader of public health organization needs : Describe the skills a leader of a public health organization needs and explain why they are needed. Justify your answer through the effective use of academic references.
Calculate the standard deviation of the portfolio : Assume that interaffiliate cash flows are uncorrelated with one another. Calculate the standard deviation of the portfolio of cash held by the centralized depository for the following affiliate members
Find the value of r if the power dissipated by r : Determine the Thévenin and Norton equivalent circuits as viewed by the load resistance R in the network of Figure P2.1.1.
Demonstrate your object-oriented programming skills : Demonstrate your object-oriented programming skills by creating a program involving multiple classes.
What is the pre-tax value : A UCF graduate has two job offers. Job 1 pays $36,500 with a $5,500 non-taxable benefit, while Job 2 pays $35,000 and has a $6,200 non-taxable benefit. What is the PRE-TAX value of each job assuming the graduate is in a 15% marginal tax bracket?
Describe the role and function you envision for yourself : The purpose of this assignment is to provide you with the opportunity to describe the role and function you envision for yourself as a counselor
Determine the selling price of the bonds : After a careful evaluation of the request, the board of directors has decided to raise funds for the new plant by issuing $3,000,000 of 11% term coporate bonds on March 1,2014, due on March 1, 2029, with interest payable each March 1 and September..
Cash flows except initial investments : The city does not pay taxes and the discount rate is 6.3%. Assume that all cash flows except initial investments happen at the end of the year and you are strongly encouraged to use a spreadsheet to solve this problem.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a test program that creates 2 shopping carts

Test the program and provide a list of comprehensive test cases used to validate the application and include these test cases in a word document containing all UML diagrams and descriptions. The test data can be shown in a table that includes inpu..

  Write a method reversefirstk

Write a method reverseFirstK that accepts an integer k and a queue of integers as parameters and reverses the order of the first k elements of the queue, leaving the other elements in the same relative order.

  This project mainly focuses on explaining your

this project focuses on demonstrating your understanding of java collections. before attempting this project be sure

  Develop a one player java multiple choice math game

Display a suitable welcome message to the player and a comprehensive description regarding the rules of the game - You have been asked to develop a one player java multiple choice math game that tests children, between ages 8 to 13 years old, abilit..

  Implement a distributed banking application

In the first part, you will implement a distributed banking application. The distributed bank has multiple branches. Every branch knows about all other branches.

  How many states are there and draw and label the states

How many states are there and draw and label the states (with variable values) and transitions (with method names). Notice that all of the methods are total.

  What is overloading and what is overriding

What is overloading and what is overriding? Wrtie JAVA code code to explain it.

  Design a class named magazinesubscription

Design a class named MagazineSubscription that has fields for a subscriber's name, the magazine name, and number of months remaining in the subscription.

  Descriptionyou are to write a program that determines the

descriptionyou are to write a program that determines the day of the week for new years day in the year 3000. to do

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write a program to store in a 2-d boolean array

Write a program to store in a 2-D boolean array of size 5 and 10 a true value if a random value is less than 0.5 else false. Print only the indexes of cells with true value.

  Identify how you can encapsulate the data

Describe the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd