You work for a Video Game Company. You have been tasked to work on a video...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You work for a Video Game Company. You have been tasked to work on a video game that is being developed. You are responsible for the player management features for the game. Specifically, you need to add the ability to assign (add) up to 6 players to the Game 1 out of 10 points Given the partial Java code below, write, in Java, the addPlayer (mutator) method which adds a Player object to the Game's instance variable Player array Assigned Players and creates a composition relationship. Remember to think about the appropriate validation. . The addPlayer method should take in the player's name (string), avatar name (string) and skill level (integer) In order to instantiate a Player object, you must have the player's name, avatar name, and skill level. Max Players is 6. Partial Java Code: //Player Data Defintion Class public class Player { private String playerName; private String avatarName; private int skillLevel; public Player (String playerName, String avatarName, int skillLevel) { this.playerName = playerName; this.avatarName = avatarName; this.skillLevel = skillLevel; } } //Game Data Definition Class public class Game{ public static final int MAX PLAYERS = 6; private String gameName; private int numberOfPlayers = 0; private Player [ ] assigned Players new Player [6]; //Add your code here!!! } Question 7 A local company provides home maintenance services in your area. Currently the company provides 2 services - Mulching Service and Lawn Mowing Service. You have been asked to create a java solution to keep track of the services provided by the company to its customers. a. Write in Java ONLY the class declarations for all classes needed to solve the problem. Your class declaration should include things such as abstract and extends where appropriate. Hint: Remember to demonstrate inheritance b. All services need a way to calculate cost of the service provided. Write the method header for a special purpose method called calculateCost which will return the cost of service provided in the super class that will force all subclasses to override it. Question 8 Suppose the class SportsCar is a derived class of a class Automobile and suppose also that the class Automobile has public methods named accelerate and addGas. Will an object of the class Sportscar have methods named accelerate and addGas? If so, do these methods have to perform the exact same actions in the class Sportscar as in the class Automobile? You work for a Video Game Company. You have been tasked to work on a video game that is being developed. You are responsible for the player management features for the game. Specifically, you need to add the ability to assign (add) up to 6 players to the Game 1 out of 10 points Given the partial Java code below, write, in Java, the addPlayer (mutator) method which adds a Player object to the Game's instance variable Player array Assigned Players and creates a composition relationship. Remember to think about the appropriate validation. . The addPlayer method should take in the player's name (string), avatar name (string) and skill level (integer) In order to instantiate a Player object, you must have the player's name, avatar name, and skill level. Max Players is 6. Partial Java Code: //Player Data Defintion Class public class Player { private String playerName; private String avatarName; private int skillLevel; public Player (String playerName, String avatarName, int skillLevel) { this.playerName = playerName; this.avatarName = avatarName; this.skillLevel = skillLevel; } } //Game Data Definition Class public class Game{ public static final int MAX PLAYERS = 6; private String gameName; private int numberOfPlayers = 0; private Player [ ] assigned Players new Player [6]; //Add your code here!!! } Question 7 A local company provides home maintenance services in your area. Currently the company provides 2 services - Mulching Service and Lawn Mowing Service. You have been asked to create a java solution to keep track of the services provided by the company to its customers. a. Write in Java ONLY the class declarations for all classes needed to solve the problem. Your class declaration should include things such as abstract and extends where appropriate. Hint: Remember to demonstrate inheritance b. All services need a way to calculate cost of the service provided. Write the method header for a special purpose method called calculateCost which will return the cost of service provided in the super class that will force all subclasses to override it. Question 8 Suppose the class SportsCar is a derived class of a class Automobile and suppose also that the class Automobile has public methods named accelerate and addGas. Will an object of the class Sportscar have methods named accelerate and addGas? If so, do these methods have to perform the exact same actions in the class Sportscar as in the class Automobile?
Expert Answer:
Related Book For
Fundamentals of Financial Accounting
ISBN: 978-0078025914
5th edition
Authors: Fred Phillips, Robert Libby, Patricia Libby
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
The CFO of the Jordan Microscope Corporation intentionally misclassified a downstream transportation expense in the amount of $575,000 as a product cost in an accounting period when the company made...
-
Approximately what fraction of the U.S. labor force belongs to unions? (Try asking this question of a person who has never studied economics.) Why do you think this fraction is so low?
-
Kohl's Department Store and Target Corporation buy their clothing from Form Fitters Inc., a merchandising firm, that has budgeted\ its activity for December according to the following information:\...
-
The current price of gold is \(\$ 412\) per ounce. The storage cost is \(\$ 2\) per ounce per year, payable quarterly in advance. Assuming a constant interest rate of \(9 \%\) compounded quarterly,...
-
1. What recommendations can you offer Tanya to be more effective in dealing with Marks tardiness problem? 2. To what extent do you think Tanya should be more tolerant with respect to Marks problem of...
-
Assume a market price is set artificially low. In other words, the price is set below the equilibrium price. How will this affect the market
-
Change is inevitable Resistance to change may come from the organization, the individual, or both. Explain in detail the sources of resistance to change below with TWO (2) appropriate examples. (i)...
-
How can the topic of "elasticity" be related to agriculture. Please Cite references for study purposes.?
-
Group Activity: 10 items x 3 points INSTRUCTIONS: 1. Find a partner. 2. For the first 10 minutes, Partner A will work on Problem Number 1, while Partner B will work on Problem Number 2. 3. In the...
-
Explain Coca-Cola's distribution network based on the designs. If there is no information or you think the current network is not working well, suggest a new design, and explain why you think it is a...
-
Describe the type of retailer you are establishing. Include the mission statement, ownership type, and products offered. Describe the type of retail format and sub-industry. Include the NAICS code (...
-
1. According to the World Economic Outlook Update (April 2023), which Advanced Economy is projected to have the lowest GDP growth this year? 2. According to the World Economic Outlook Update (April...
-
Respond that the following statements are TRUE or FALSE: 1) A cellular phone manufacturer is more likely to use a process costing system, rather than job order costing. 2) Both job order costing and...
-
Using a graphing utility, graph y = cot -1 x.
-
A construction contract differs from contracts that we generally deal with that focus on an easily defined physical object because the physical object can be examined. How is the object of a...
-
What does the owner contribute to the project and what does the contractor contribute to the project?
-
For what type of project is a line-of-balance schedule particularly suited? Identify specific examples.
Study smarter with the SolutionInn App