« All Events
5:30 PM – Intro To Python – Gamas
December 6, 2022 @ 5:30 pm - 6:30 pm
Homework
- Inside Nov29_RobuxShoppingCart.py
- Call make_purchase function for HAIR and VIP Server products. This is very similar on how you call make_purchase for HAT product.
- Add code that will implement “4. Add more robux” so it can do the following
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: 4
Enter your Credit Card number: ABCD1234
Thank you for purchasing 200 Robux. You now have 250 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: 4
Enter your Credit Card number: asdfasdfasdfasdf
You have entered an invalid credit card number