Lab 11 - Example output
Overview
User input shown in bold
$ python3 sworthmore.py
Welcome to Sheetz!
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 2
Enter the item number to sell: 1
Enter the quantity to sell: 10
Sold 10 of item 1.
Revenue from sale: $13.00
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 4
Current balance: $13.00
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 3
Enter the item number to restock: 1
Enter the quantity to restock: 10
Success!
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 4
Current balance: $1.30
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 0
Goodbye!
Bad menu options
User input shown in bold
python3 sworthmore.py
Welcome to Sheetz!
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: -1
Invalid choice. Please try again.
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: puppies
Invalid choice. Please try again.
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 5
Invalid choice. Please try again.
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Bad Index
User input shown in bold
Welcome to Sheetz!
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 2
Enter the item number to sell: puppies
Invalid input. Please enter a number.
Enter the item number to sell: 0
Invalid item index. Please enter a number between 1 and 5.
Enter the item number to sell: 7
Invalid item index. Please enter a number between 1 and 5.
Enter the item number to sell: 3
Enter the quantity to sell: 10
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 90
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 4
Current balance: $12.00
Bad Quantity
User input shown in bold
Welcome to Sheetz!
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 1
Inventory for Sheetz:
Item Price Qty
1. Soft Pretzel $1.30 50
2. Cheerwine $2.25 30
3. Water $1.20 100
4. Trail Mix $4.50 20
5. Pocky Sticks $3.00 12
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 2
Enter the item number to sell: 5
Enter the quantity to sell: 15
Not enough quantity available.
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 4
Current balance: $0.00
Please choose an option:
1. Show inventory
2. Sell item
3. Restock item
4. Show balance
0. Quit
Enter your choice: 3
Enter the item number to restock: 5
Enter the quantity to restock: 10
Insufficient balance to restock.