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:

  1. Create the Character class: This class will have the attributes: characterName, characterType, and hitPoints.

    1.1. All attributes will be set by user input.

    1.2. Include appropriate getter and setter methods for these attributes.

  2. Create the VideoGame class: This class will have the attributes: gameName, genre, and mainCharacter.

    2.1. The gameName and genre attributes will be set by user input.

    2.2. The mainCharacter attribute will be an object of the Character class.

    2.3. Include appropriate getter and setter methods for these attributes.

  3. Create the GameStudio class: This class will have the attributes: studioName, location, and publishedGame.

    3.1. The studioName and location attributes will be set by user input.

    3.2. The publishedGame attribute will be an object of the VideoGame class.

    3.3. Include appropriate getter and setter methods for these attributes.

  4. 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, and GameStudio 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:

  1. Java class files

  2. Screenshot of the Console with the code executing

 

COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark