American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5pm Intro To Python – Bill

March 2, 2022 @ 5:00 pm - 6:00 pm

Today We:
  1. Continued the Shopping Cart system project
  2. Learned how to check if the user’s response is not something we are looking for
  3. Added elif statements to check the possible options of the user input
  4. Made the system keep track of the items the user purchases using a list
  5. Made the system keep track of the total cost using a price variable
  6. Printed out the list at the end when the user checks out
  7. Printed out the total cost at the end when the user checks out
  8. Made the menu, list, and total cost display more readable
Your HW:

Create a new program called “Mar2_RobuxShoppingCart”. This program will be similar to the shopping cart program that we made:

Welcome to Robux Bank, you have 300 robux in the beginning.

What do you want to do: 
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 1
You purchased a Hat. You have 200 robux remaining.

What do you want to do: 
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 2
You purchased a Hair. You have 50 robux remaining.

What do you want to do: 
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 3
You only have 50 robux remaining. Therefore you cannot purchase VIP Server for 500 robux.

What do you want to do: 
1. Buy hat 100 Robux
2. Buy hair 150 Robux
3. VIP Server 500 Robux
4. Add more Robux
5. Exit
Enter your selection: 5

You have purchased the following items:
1. Hat
2. Hair
Your remaining Robux balance is 50 Robux.

Please allow the user to keep track of the amount of money spent and the items purchased. You do not need to worry about option 4 yet, we will cover this in the next class.

If you have any questions, please email me at billhan@ayclogic.com

 

Details

Date:
March 2, 2022
Time:
5:00 pm - 6:00 pm
Verified by MonsterInsights