« All Events
7 PM – Intro to Python – Parna
July 28, 2022 @ 7:00 pm - 8:00 pm
Today We Do
- We went over the RobuxShoppingCart Program
Homework
- Edit the current RobuxShoppingCart program so that a function can be used to purchase items from the menu and add them to the shopping cart. Look for repetition in code to help create this function that we began coding in class.
- Expected Behavior should be like this:
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 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: 3
You only have 200 robux left. 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: 4
Enter your Credit Card number: ABCD1234
Thank you for purchasing 200 Robux. You have 400 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 have purchased a Hair. You 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: 5