Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project, you will create a simple program using OOP format that has two classes. One of the classes will be an object class.

In this project, you will create a simple program using OOP format that has two classes. One of the classes will be an object class. The object class will be used to define the attributes of a Monster and it will contain all of the instance variables and methods needed to construct once instance of a Monster. An instance of a Monster could be such things as traditional monsters like vampires, ogres and werewolves or they can be anything your imagination can create. The important thing is to think about what all of your monsters will have in common as well as what information you need to store about them. They should have at least 5 attributes, such as a name, species and so on. The user should be able to update all of the attributes (instance variables) using setter methods and at least two of the attributes should be numeric values. The numeric values should have at least one method each that contains a calculation. For example, the program could have an instance variable that keeps track of the monster's strength and there can be a method to add to the strength points.

The second required class is a Tester/Runner/Driver class that contains the main method. The specific functionality of the program is up to you, but the program must have at least 5 defined Monsters. The Monster objects should be saved in an ArrayList and the getter/setter methods should use the ArrayList methods to update the attributes. The program must be interactive and ask the user for information that is used to display and update information about the monsters. The object class getter and setter methods should be used to display and manipulate the contents of the instance variables in the object class. There should be a menu that allows the user to interact with the program. At a minimum, the user should be able to display all the information about the monster of the user's choice, update information about the monster and use the calculation methods. Because this your first program, please keep the scale of the program at a modest level. The purpose of this project is to give you a chance to write a simple program in Java using objects.

While this is a relatively modest program, it is best practice to start by writing pseudocode. Plan out your program, what interactions you want the user to have with your Monsters and the interactions of your Monsters with each other.

Program Requirements

This exercise is designed to be a short program that will give you a chance to refresh your Java skills as well as to give you a chance to practice with OOP design. The program must meet the following criteria:

  • The program must be written entirely in JAVA.
  • In the Object class:
    • Instance variables must be properly declared and initialized.
    • Constructor(s) must be properly declared.
    • The must be at least 5 attributes for the monster and 2 of them must be numeric fields.
    • There must be getter and setter methods for all instance variables.
    • There are at least two methods used for calculations that update the numeric instance variables.
  • In the Tester/Runner/Driver class:
    • The variables must be properly declared and initialized.
    • There should be at least 5 Monster objects saved in an ArrayList.
    • An object instance should be used to access all methods in the Object class.
    • The program must use a loop. The type of loop is up to you.
    • The user must be able to enter information that is used in the program.
    • A menu allowing the user to make selections must be presented.
    • The user must be able to display all of the information about a monster of the user's selection and update the attributes of a monster.
  • You must properly comment and document your code (see the documentation about commenting code in the first modules of the course or ask me if you have any questions)
  • You may name your program and files with any reasonable names of your choosing but I should be able to clearly identify the Tester class and the Object class. Names such as MonsterTester for the tester and Monster for the object are good options.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago