Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

Why would a country rather domesticate than expropriate?

Answered: 1 week ago

Question

3. Explain the forces that influence how people handle conflict

Answered: 1 week ago