Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

intro to java first picture is the question the rest are the programs that are involved with it n.suny.edu/bbcswebdav/pi d-415289-dt-content-rid-1398325_1/courses/201801-X16-Cs249-CS505/CS 249 Assign05.pdt Healing Power: 20

image text in transcribed

intro to java first picture is the question the rest are the programs that are involved with it

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

n.suny.edu/bbcswebdav/pi d-415289-dt-content-rid-1398325_1/courses/201801-X16-Cs249-CS505/CS 249 Assign05.pdt Healing Power: 20 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: assume the name is a single word. Ask the user if it's a food item. 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

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_2

Step: 3

blur-text-image_3

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

How does inadequate laws and enforcement affect animal rights?

Answered: 1 week ago

Question

Identify the cause of a performance problem. page 363

Answered: 1 week ago