Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 Game Consider the following class: public class Game { private String description; public Game String newDescription) setDescription(newDescription); public String getDescription() return description; blic void

image text in transcribedimage text in transcribed

4 Game Consider the following class: public class Game { private String description; public Game String newDescription) setDescription(newDescription); public String getDescription() return description; blic void setDescription(String newDescription) description=newDescription; public String toString() return( "description : "+ description); 4.1 PC-Based Game Write a class encapsulating a PC-based game in the package com.labs.lab6.games , which inherits from Game . A PC-based game has the following additional attributes: the minimum megabytes of RAM needed to play the game, the number of MB needed on the hard drive to install the game, and the minimum GHz performance of the CPU. Code the constructor and the toString method of the new class. You also need to include a client class to test your code. 4.1 PC-Based Game Write a class encapsulating a PC-based game in the package com.labs.lab6.games, which inherits from Game . A PC-based game has the following additional attributes: the minimum megabytes of RAM needed to play the game, the number of MB needed on the hard drive to install the game, and the minimum GHz performance of the CPU. Code the constructor and the toString method of the new class. You also need to include a client class to test your code. 4.2 Board Game Write a class encapsulating a board game in the package com.labs.lab6.games, which inherits from Game . A board game has the following additional attributes: the number of players and whether the game can end in a tie. Code the constructor and the toString method of the new class. You also need to include a client class to test your code. 4.3 Sports Game Write a class encapsulating a sports game in the package com.labs.lab6.games , which inherits from Game . A sports game has the following additional attributes: whether the game is a team or individual game, and whether the game can end in a tie. Code the constructor and the toString method of the new class. You also need to include a client class to test your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions