Question: Console Wizard Inventory COMMAND MENU walk - Walk down the path show - Show all items drop - Drop an item exit - Exit program

Console Wizard Inventory

COMMAND MENU

walk - Walk down the path

show - Show all items

drop - Drop an item

exit - Exit program

Command: walk

While walking down a path, you see a scroll of uncursing.

Do you want to grab it? (y/n): y

You picked up a scroll of uncursing.

Command: walk

While walking down a path, you see an unknown potion. Do you want to grab it? (y/n): y

You cant carry any more items. Drop something first.

Command: show

1. a wooden staff

2. a scroll of invisibility

3. a crossbow

4. a scroll of uncursing

Command: drop

Number: 3

You dropped a crossbow.

Command: exit

Bye!

Specifications Use the file named wizard all items.txt that contains a list of all possible items that a wizard can carry. When the user selects the walk command, read these items from the file, randomly pick one, and give the user the option to grab it. In another file, store the current items that the wizard is carrying. Make sure to update this file every time the user grabs or drops an item. The wizard can only carry four items at a time. For the drop command, display an error message if the user enters an invalid number for the item. Use functions to organize the code for this program.

PLEASE WRITE IN C++, I AM CURRENTLY ONLY STUCK ON THE DROP ITEM PORTION OF THE PROGRAM. I AM ALSO HAVING DIFFICULTIES WITH TH FULL WORD COMMAND PROMPT. WHEN WRITING THE CODE, IF YOU COULD PUT SOME EXPLANATION INTO THE DROP PART OF THE CODE THAT WOULD BE GREATLY APPRECIATED.

THANK YOU

wizard_all_items.txt

a wooden staff a wizard hat a cloak of invisibility some elven bread an unknown potion a scroll of uncursing a scroll of invisibility a crossbow a wizard's cloak

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!