Question: Implement a class Assign05 to test the Player, Item, and Food classes. In its main method: Create a Player instance, player, with position (3,3). Do

 Implement a class Assign05 to test the Player, Item, and Food

classes. In its main method: Create a Player instance, player, with position

(3,3). Do the following in a loop: Ask the user for anitem name and weight. You can assume the name is a singleword Ask the user if it's a food ite If user enters"Y",then ask for healing power If item is NOT a food item,

Implement a class Assign05 to test the Player, Item, and Food classes. In its main method: Create a Player instance, player, with position (3,3). Do the following in a loop: Ask the user for an item name and weight. You can assume the name is a single word Ask the user if it's a food ite If user enters "Y",then ask for healing power If item is NOT a food item, create an Item instance and add it to player inventory If item IS a food item, create a Food instance and add it to player inventory ..while the user doesn't enter a String "None" for the name. Print player inventory. Ask user to choose an item to use (enter an integer) If the item was successfully used, print the current Player health. Otherwise, print "Cannot use this item." Implement a class Assign05 to test the Player, Item, and Food classes. In its main method: Create a Player instance, player, with position (3,3). Do the following in a loop: Ask the user for an item name and weight. You can assume the name is a single word Ask the user if it's a food ite If user enters "Y",then ask for healing power If item is NOT a food item, create an Item instance and add it to player inventory If item IS a food item, create a Food instance and add it to player inventory ..while the user doesn't enter a String "None" for the name. Print player inventory. Ask user to choose an item to use (enter an integer) If the item was successfully used, print the current Player health. Otherwise, print "Cannot use this item

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!