Module 3 - Lab - Game Character
Objective
The goal of this lab assignment is to enhance your understanding of object-oriented programming in Java, particularly the concept of aggregation. This assignment will focus on creating and manipulating classes that represent elements in a video game world.
Instructions:
Create the
Character
class: This class will have the attributes:characterName
,characterType
, andhitPoints
.1.1. All attributes will be set by user input.
1.2. Include appropriate getter and setter methods for these attributes.
Create the
VideoGame
class: This class will have the attributes:gameName
,genre
, andmainCharacter
.2.1. The
gameName
andgenre
attributes will be set by user input.2.2. The
mainCharacter
attribute will be an object of theCharacter
class.2.3. Include appropriate getter and setter methods for these attributes.
Create the
GameStudio
class: This class will have the attributes:studioName
,location
, andpublishedGame
.3.1. The
studioName
andlocation
attributes will be set by user input.3.2. The
publishedGame
attribute will be an object of theVideoGame
class.3.3. Include appropriate getter and setter methods for these attributes.
Write your main program:
4.1. Use the
Scanner
class to collect user input for the character's name, type, and hit points, the video game's name and genre, and the game studio's name and location.4.2. Instantiate the
Character
,VideoGame
, andGameStudio
classes with the information provided by the user.4.3. Finally, output the information about the game studio, the published video game, and the main character in a clear and engaging format.
Make sure to follow best practices for clean, efficient code, including using appropriate naming conventions, encapsulation, and include comments to explain your code. Your grade will be based on your understanding and application of the aggregation concept, correctness of your code, and adherence to coding best practices. Good luck!
Note: Use Copy constructors where appropriate
Deliverables
Upload the following files in a zip folder that you have created:
Java class files
Screenshot of the Console with the code executing
COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark