- This event has passed.
7 PM – Intro To Python
July 23, 2021 @ 7:00 pm - 8:00 pm
Today We Do
- We reviewed everyone python projects. If you guys still want to revise, you guys can resubmit by 12 midnight Los Angeles time.
- We started Robux Shopping Cart program
Homework
- In the Robux Shopping Cart program, you have to add code to do “4. Add more Robux”.
- When user select 4, the program need to ask user to enter his/her credit card number.
- When the credit card number is equal to ABCD1234 then add the robux balance by 200 more.
- If the credit number is not equal to ABCD1234, print “You have entered an invalid Credit Card number”.
- Also when user select “5”, print all the items that user has purchased and his/her remaining robux balance.
Example 1
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 have purchased Hat for 100 Robux, you have 200 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 have purchased Hair for 150 Robux, you have 50 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: 5 You have purchased the following items: hat hair Your remaining Robux balance is 50 Robux.
Example 2
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 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: 4 Enter your Credit Card number: asdfadf Unfortunately, you have entered an invalid giftcard number. 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: