Question: Java - simple program in OOP format with two classes. (Thank you for your help in advance) An object class will be one of the
Java - simple program in OOP format with two classes. (Thank you for your help in advance)
An object class will be one of the classes. The object class will be used to define a Monster's attributes and contain all of the instance variables and methods required to construct one instance of a Monster. Monsters can be traditional monsters like vampires, ogres, werewolves, or anything else. They must have at least 6 characteristics, such as a name, species, and so on. The user should be able to use setter methods to update all attributes (instance variables), and at least two of the attributes should be numeric values. Each numerical value should have at least one method that includes a calculation. For example, the program could include an instance variable that tracks the monster's health and a method for adding to or subtracting from the health points.
The primary method is contained in the Tester/Runner/Driver class, the second required class. The program's specific functionality is up to you but must have at least 10 defined monsters. The Monster objects should be saved in an ArrayList, and the getter/setter methods should update the attributes using the ArrayList methods. The program must be interactive and ask the user for information that will be used to display and update monster information. Use the getter and setter methods to display and manipulate the contents of the object class's instance variables. A menu should allow the user to interact with the program. At the very least, the user should be able to display all of the information about the monster of choice, update information about the monster, and use the calculation methods. The program should loop until the user decides to exit by selecting the appropriate menu option. When the program runs, the ArrayList in the tester class should have 10 defined objects with the option to add more to the ArrayList.
Program Requirements
* Your code must be properly commented on and documented. Assignments that use infinite loops (such as while(true) and switch/case statements) are NOT allowed. *
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. - There must be at least 6 attributes for the monster, and 2 must be numeric fields. - There must be getter and setter methods for all instance variables. - There are at least two calculation methods 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 10 Monster objects saved in an ArrayList when the program launches with the option for the user to add more. - 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
