Question: I need help. Java/ chapter 11: Inheritance and Polymorphism Part 1 - Copy the provided code below that shows usage of a class named Game
I need help. Java/ chapter 11: Inheritance and Polymorphism Part 1 - Copy the provided code below that shows usage of a class named Game (Game.java) into a folder where you will write the program for this exercise. Write the definition of a class that inherits from Game. This class will have the additional attributes of minimum size of RAM (in gigabytes) required to play the game, the minimum size of hard drive space (in gigabytes) required to install the game, and the minimum CPU speed (in GHz). Code the constructor and the toString method for this new class. Create a test class to thoroughly test your utility class. Make sure to allow for user input as you test your code. Create various objects and show how methods are utilized. A minimal amount of testing will not be granted too many points. You will have 2 Java source files for this exercise, one for the utility class and the other for the testclass.
Part 2 - This can be done in one file, if you like. There is no need to create a utility and main class. Write a program that uses the ArrayList class to store objects. Do NOT use static arrays that we used in earlier chapters. Your textbook has examples taht may be helpful. Write a program to process employee salaries. Store the full name (foo bar), the number of hours worked, and pay rate of employees using ArrayList objects. You can define an ArrayList for employee names, an ArrayList for hours, etc. We also need to be able to store the employee pay by calculating pay (hours * rate). MUST use MRETHODS! Theyre ideal for this project.
a) Prompt the user to enter some data for a list of potential employees. Of course, you need a loop to keep asking the user to enter data. The user should be able to enter as many data records as she wishes. A method should be used here to gather the data.
b) Create a new array list to hold the pay for each employee.
c) Display the size of the array lists. Make sure to be very descriptive in your output.
d) Ask the user to enter the name of an employee and check if the person exists in the array list. Your search must be case insensitive. Display the message EMPLOYEE found, if the name is found in the list and display the employees corresponding employee information (name, hours, rate, and pay). Otherwise, display EMPLOYEE NOT found. EMPLOYEE is the name of the person. So, if the input for name is Foo Bar, well display something like foo Bar, 10 20 200. If the input for name is Bill Bob, well display something like Bill Bob NOT found, if we dont have an employee named Bill Bob. A method should be used here for the search process.
e) Allow the user to add more names. A method should be used here.
f) Allow the user to remove names. If the name to be removed cannot be found, display an error message. A method should be used here.
g) Display the name of the employee with the highest salary. A method should be used here.
h) Display the data in a tabular format (name, hours, rate, and pay). A method should be used here.
Special requirement: By the end of this assignment, you will have a set of Java source files. The .java files would need to be compressed and submit one compressed file. You may want to create folders on your machine, one for each part of the assignment, and submit the compressed files of the folders.
[ public class Game {
private String description;
public Game(String d) {
description = d;
}
public String getdescription() {
return description;
}
public void setDescription(String d) {
description = d;;
}
public String toString(){
return "description = " + description;
}
}//class Game ] copy code within this bracket for part 1 (Game.java)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
