Submission: This should be a separate file from problem one, save to the file a2q2.py Goals: Use multiple variables to track independent information, make use of while loops to process until the user wants to quit, begin writing reusable code.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please help!

icely formatted
Problem 2: Bulk Purchases
Submission: This should be a separate file from problem one, save to the file a2q2.py
Goals: Use multiple variables to track independent information, make use of while loops to
process until the user wants to quit, begin writing reusable code.
Firstly, copy your a2q1.py solution into a new file. The TAS will need both solutions. Save it as
a2q2.py.
In this problem, you will modify your previous solution şo that we can purchase multiple loot
boxes at once.
1. Our menu will now need a "Complete Purchase" option to stop purchasing (you can
rename this, as long as it is clear)
2. Our menu will continue prompting for additional purchases until the selects the Complete
Purchase option
3. We will need to track how many of each type of loot box we are purchasing - one
variable per type
4. If the user selects the same box a second or third time, it should be added to the
previous amount
5. The receipt should contain a list of each box they have purchased; if they did not
purchase a type of box, it should not appear on the receipt
Tips: You will want variables for each type of box with information like the cost, the amount
you've purchased, and poss ibly even the name of the box. For clarity, try defining these
variables together and early in the program.
Transcribed Image Text:icely formatted Problem 2: Bulk Purchases Submission: This should be a separate file from problem one, save to the file a2q2.py Goals: Use multiple variables to track independent information, make use of while loops to process until the user wants to quit, begin writing reusable code. Firstly, copy your a2q1.py solution into a new file. The TAS will need both solutions. Save it as a2q2.py. In this problem, you will modify your previous solution şo that we can purchase multiple loot boxes at once. 1. Our menu will now need a "Complete Purchase" option to stop purchasing (you can rename this, as long as it is clear) 2. Our menu will continue prompting for additional purchases until the selects the Complete Purchase option 3. We will need to track how many of each type of loot box we are purchasing - one variable per type 4. If the user selects the same box a second or third time, it should be added to the previous amount 5. The receipt should contain a list of each box they have purchased; if they did not purchase a type of box, it should not appear on the receipt Tips: You will want variables for each type of box with information like the cost, the amount you've purchased, and poss ibly even the name of the box. For clarity, try defining these variables together and early in the program.
Tip: You can use global constant values to give names to the selections in your code! Example:
COMMON = 1
RARE = 2
EPIC = 3
QUIT = 4
Example:
HELLO, GAMER! Welcome to the Raven Runner Loot Box Purchasing System.
First, what's your player name? Connor
Please select a loot box from the menu below:
1. [Common] The GeeGee (1.50)
2. [Rare]
3. [Epic]
4. Complete Purchase
The Raven (3.00)
The Three-Eyed Raven (7.99)
> 1
How many GeeGees ($1.50) would you like to purchase?2
Please select a loot box from the menu below:
The GeeGee (1.50)
1. [Common]
2. [Rare]
3. [Epic]
4. Complete Purchase
The Raven (3.00)
The Three-Eyed Raven (7.99)
> 2
How many Ravens ($3.00) would you like to purchase? 4
Please select a loot box from the menu below:
1. [Common] The GeeGee (1.50)
2. [Rare]
3. [Epic]
The Raven (3.00)
The Three-Eyed Ravern (7.99)
4. Complete Purchase
> 3
How many Three-Eyed Ravens ($7.99) would you like to purchase? 1
Please select a loot box from the menu below:
1. [Commorn] The GeeGee (1.50)
2. [Rare]
3. [Epic)
4. Complete Purchase
The Raven (3.00)
The Three-Eyed Raven (7.99)
> 4
Thanks, Connor! Here is your receipt:
1x
GeeGees (1.50)
Ravens ($3.00)
Three-Eyed Ravens ($7.99)
4x
1x
Total Cost: $22.99
Good luck, gamer!
石
Transcribed Image Text:Tip: You can use global constant values to give names to the selections in your code! Example: COMMON = 1 RARE = 2 EPIC = 3 QUIT = 4 Example: HELLO, GAMER! Welcome to the Raven Runner Loot Box Purchasing System. First, what's your player name? Connor Please select a loot box from the menu below: 1. [Common] The GeeGee (1.50) 2. [Rare] 3. [Epic] 4. Complete Purchase The Raven (3.00) The Three-Eyed Raven (7.99) > 1 How many GeeGees ($1.50) would you like to purchase?2 Please select a loot box from the menu below: The GeeGee (1.50) 1. [Common] 2. [Rare] 3. [Epic] 4. Complete Purchase The Raven (3.00) The Three-Eyed Raven (7.99) > 2 How many Ravens ($3.00) would you like to purchase? 4 Please select a loot box from the menu below: 1. [Common] The GeeGee (1.50) 2. [Rare] 3. [Epic] The Raven (3.00) The Three-Eyed Ravern (7.99) 4. Complete Purchase > 3 How many Three-Eyed Ravens ($7.99) would you like to purchase? 1 Please select a loot box from the menu below: 1. [Commorn] The GeeGee (1.50) 2. [Rare] 3. [Epic) 4. Complete Purchase The Raven (3.00) The Three-Eyed Raven (7.99) > 4 Thanks, Connor! Here is your receipt: 1x GeeGees (1.50) Ravens ($3.00) Three-Eyed Ravens ($7.99) 4x 1x Total Cost: $22.99 Good luck, gamer! 石
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Troubleshooting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education