Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

roup/afeosf5f fac3 4527-915a 366ff83ds465/Lab%20Assignment%20Files/Labos/ES1036b s Lab format, approach, design and pre-thought provided by Dr. Quazi Rahman E.2. Question 2: Improving the Text-based RPG vendor (60

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
roup/afeosf5f fac3 4527-915a 366ff83ds465/Lab%20Assignment%20Files/Labos/ES1036b s "Lab format, approach, design and pre-thought provided by Dr. Quazi Rahman E.2. Question 2: Improving the Text-based RPG vendor (60 Marks) Requirement: Update your store program to use modular programming Additionally, use a global variable to store your user's currency so that you may access and modify it anywhere in your program. Updated Specifications: 1. The program will print your info and a message that describes its mission (Must use the function you created in Lab04) 2. Customer is asked how much currency they have available which is stored to a global variable and displayed when they purchase. 3. Program explains how all shops are closed other than the one you create Program asks if the customer (the user) wants to enter the open shop. (If they don't, the program exits.) 5. Program introduces the shop and displays the available items and how much each costs (Minimum of 4 items). I 6. Customer is asked to pick an item from the list to purchase. If the customer picks an item not on the list, they are told that item doesn't exist or is no longer available and are asked to try again. Additionally, a final option under available items is available to exit the store. 7. If the customer has enough currency, the item's cost is deducted from their total currency and the purchased item is removed from the available items. If the customer doesn't have enough currency, they are told to try another item. 8. Program then outputs the item which was purchased and the remaining currency the customer has left. After a purchase is made, they are shown the new list of items available (with the one they bought no longer available) to buy more. If all items have been purchased, the store closes. Design tips: Find pieces/chunks of your code with "repeating patterns' which can be converted into void functions. See the pre-lab for a good example. Implementation Hints: A double colon before a variable name will access the global variable with that name

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

l Identify two age discrimination issues.

Answered: 1 week ago