Sample output 1: Enter code: B001 Enter quantity: 10 Enter date of birth (DD-MM-YYYY): 01-01-1957 Are you a member? (yes/no): no Your payment is RM299.00 Sample output 2: Enter code: A001 Enter quantity: 3 Enter date of birth (DD-MM-YYYY) : 01-07-1998 It is your birthday month! You will receive 25% discount! Are you a member? (yes/no): yes Enter your initial points: 320 You can redeem 3 cake (s). Do you want to redeem now? (yes/no): yes How many pieces?: 5 Redemption fail. Cannot redeem more than 3 cake (s). Your points left 355 Your payment is RM35.78 Hint: Assume all input(s) is/are correct.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Note this is a practice question

Sample output 1:
Enter code: B001
Enter quantity: 10
Enter date of birth (DD-MM-YYYY): 01-01-1957
Are you a member? (yes/no) : no
Your payment is RM299.00
Sample output 2:
Enter code: A001
Enter quantity: 3
Enter date of birth (DD-MM-YYYY) : 01-07-1998
It is your birthday month! You will receive 25% discount!
Are you a member? (yes/no) : yes
Enter your initial points: 320
You can redeem 3 cake (s).
Do you want to redeem now? (yes/no) : yes
How many pieces?: 5
Redemption fail. Cannot redeem more than 3 cake (s).
Your points left 355
Your payment is RM35.78
Hint: Assume all input(s) is/are correct.
Transcribed Image Text:Sample output 1: Enter code: B001 Enter quantity: 10 Enter date of birth (DD-MM-YYYY): 01-01-1957 Are you a member? (yes/no) : no Your payment is RM299.00 Sample output 2: Enter code: A001 Enter quantity: 3 Enter date of birth (DD-MM-YYYY) : 01-07-1998 It is your birthday month! You will receive 25% discount! Are you a member? (yes/no) : yes Enter your initial points: 320 You can redeem 3 cake (s). Do you want to redeem now? (yes/no) : yes How many pieces?: 5 Redemption fail. Cannot redeem more than 3 cake (s). Your points left 355 Your payment is RM35.78 Hint: Assume all input(s) is/are correct.
Practice Question 2
Q2.
Sweet Bakery sells TWO (2) different cheesecakes online. Write a COMPLETE
PYTHON PROGRAM that allows the online bakery store to sell the cakes. The
descriptions of the cakes are shown in Table 2.1.
Table 2.1
Cake
Code
Price
Marble Cheesecake
A001
RM15.90
Salted Caramel Cheesecake
B001
RM29.90
The requirements of the program are as follows:
The program requires customer to key in the cake code and the cake quantity.
The online bakery store is giving away 25% discount for customer whose
birthday falls in July. The program will receive the birthday in DD-MM-
YYYY format. The customer will automatically receive the discount once it
detects the birthday month is July.
The online bakery store has a member point system. For every RM1 purchase,
the member will receive ONE (1) point. For every 100 points, the member can
redeem ONE (1) cake.
If the customer is a member, the customer needs to key in the initial point(s).
The program will calculate the newly accumulated points based on the
purchase and determine the number of cake(s) the customer can redeem.
If the customer redeems the cakes more than the amount, the redemption
would fail, and the points will be maintained. Otherwise, the program will
confirm and deduct the points based on the number of cake(s) redeemed.
The program will display the points left (if applicable) and its total payment.
Note: Only techniques/methods/codes learned in this course such as if-else, list and
others are allowed in this program. No self- or user-defined function is allowed.
Transcribed Image Text:Practice Question 2 Q2. Sweet Bakery sells TWO (2) different cheesecakes online. Write a COMPLETE PYTHON PROGRAM that allows the online bakery store to sell the cakes. The descriptions of the cakes are shown in Table 2.1. Table 2.1 Cake Code Price Marble Cheesecake A001 RM15.90 Salted Caramel Cheesecake B001 RM29.90 The requirements of the program are as follows: The program requires customer to key in the cake code and the cake quantity. The online bakery store is giving away 25% discount for customer whose birthday falls in July. The program will receive the birthday in DD-MM- YYYY format. The customer will automatically receive the discount once it detects the birthday month is July. The online bakery store has a member point system. For every RM1 purchase, the member will receive ONE (1) point. For every 100 points, the member can redeem ONE (1) cake. If the customer is a member, the customer needs to key in the initial point(s). The program will calculate the newly accumulated points based on the purchase and determine the number of cake(s) the customer can redeem. If the customer redeems the cakes more than the amount, the redemption would fail, and the points will be maintained. Otherwise, the program will confirm and deduct the points based on the number of cake(s) redeemed. The program will display the points left (if applicable) and its total payment. Note: Only techniques/methods/codes learned in this course such as if-else, list and others are allowed in this program. No self- or user-defined function is allowed.
Expert Solution
steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY