Explain this python codes

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%

Explain this python codes

1 print("\tchoose you drink from our menu: ")
2 print("\t\t------ MENU
3 print("Produce Code")
4 print("[C1]\tIced Tea-
print("[C2]\tPopcorn----
print("\n\NNOTE: Enter product code one at a time!")
order = input("\nWould you want to order? (Y/N): ")
8 - if order.upper() == "Y":
-")
-S(25),M(35),L(45)")
---S(45),M55),L(75)")
6
7
9 -
while True:
productCode = input("\nwhat is your order?\n(Enter the product code): ")
if productCode == "C1":
while True:
10
11
12 -
size = input("\nWhat is the size? (S/M/L): ")
if size.upper()
howMany
print("--
print(f"\nYou ordered {hoWMany} small Iced Tea @ P25")
print("-
13
= "S":
int(input (f"\nHow many order of {productCode}? "))
14
15
16
")
17
18
")
total
howMany*25
19
print(f"\nAmount to pay is P{total}")
print("-
while True:
20
21
")
22 -
amount = float(input("\nPlease enter payment amount: "))
if amount>total:
change = amount-total
print(f"\nI received {amount}")
print(f"\nYour change is P{change}")
print("\n**** Thank You ****")
23
24
25
26
27
28
29
break
30
else:
31
print(f"\nYour payment is not enough. Please pay P{total}")
print("--
break
32
--")
33
elif size.upper()
howMany = int(input(f"\nHow many order of {productCode}? "))
print(":
print(f"\nYou ordered {howMany} medium Iced Tea @ P35")
print("-
34
"M":
==
35
36
--")
37
38
---")
Transcribed Image Text:1 print("\tchoose you drink from our menu: ") 2 print("\t\t------ MENU 3 print("Produce Code") 4 print("[C1]\tIced Tea- print("[C2]\tPopcorn---- print("\n\NNOTE: Enter product code one at a time!") order = input("\nWould you want to order? (Y/N): ") 8 - if order.upper() == "Y": -") -S(25),M(35),L(45)") ---S(45),M55),L(75)") 6 7 9 - while True: productCode = input("\nwhat is your order?\n(Enter the product code): ") if productCode == "C1": while True: 10 11 12 - size = input("\nWhat is the size? (S/M/L): ") if size.upper() howMany print("-- print(f"\nYou ordered {hoWMany} small Iced Tea @ P25") print("- 13 = "S": int(input (f"\nHow many order of {productCode}? ")) 14 15 16 ") 17 18 ") total howMany*25 19 print(f"\nAmount to pay is P{total}") print("- while True: 20 21 ") 22 - amount = float(input("\nPlease enter payment amount: ")) if amount>total: change = amount-total print(f"\nI received {amount}") print(f"\nYour change is P{change}") print("\n**** Thank You ****") 23 24 25 26 27 28 29 break 30 else: 31 print(f"\nYour payment is not enough. Please pay P{total}") print("-- break 32 --") 33 elif size.upper() howMany = int(input(f"\nHow many order of {productCode}? ")) print(": print(f"\nYou ordered {howMany} medium Iced Tea @ P35") print("- 34 "M": == 35 36 --") 37 38 ---")
118
print("\n**** Thank You ****")
119
break
else:
print(f"\nYour payment is not enough. Please pay P{total}")
120
121
print("
break
122
-")
123
elif size.upper()
howMany = int (input(f"\nHow many order of {productCode}? "))
print("-
print(f"\nYou ordered {howMany} large Popcorn @ P75")
print("-
124
== "L":
125
126
-")
127
128
")
total
howMany*75
129
print(f"\nAmount to pay is P{total}")
print("-
130
131
")
132
while True:
amount = float(input("\nPlease enter payment amount: "))
if amount>total:
change = amount-total
print(f"\nI received {amount}")
print(f"\nYour change is P{change}")
print("\n**** Thank You ****")
133
134
135
136
137
138
139
break
140
else:
141
print(f"\nYour payment is not enough. Please pay P{total}")
print("
break
142
--")
143
144
else:
print(f"\n{size} is not available size!")
again = input ("\nWould you want to place your order again? (Y/N): ")
if again
productCode
145
146
147 -
== "Y":
148
input ("\nWhat is your order?\n(Enter the product code): ")
=
149 -
else:
150
quit()
151 -
else:
print(f"\n\n{productCode} product code not available")
order = input("\nJust enter Y if you're ready to order: ")
152
153
154 - else:
155
quit()
Transcribed Image Text:118 print("\n**** Thank You ****") 119 break else: print(f"\nYour payment is not enough. Please pay P{total}") 120 121 print(" break 122 -") 123 elif size.upper() howMany = int (input(f"\nHow many order of {productCode}? ")) print("- print(f"\nYou ordered {howMany} large Popcorn @ P75") print("- 124 == "L": 125 126 -") 127 128 ") total howMany*75 129 print(f"\nAmount to pay is P{total}") print("- 130 131 ") 132 while True: amount = float(input("\nPlease enter payment amount: ")) if amount>total: change = amount-total print(f"\nI received {amount}") print(f"\nYour change is P{change}") print("\n**** Thank You ****") 133 134 135 136 137 138 139 break 140 else: 141 print(f"\nYour payment is not enough. Please pay P{total}") print(" break 142 --") 143 144 else: print(f"\n{size} is not available size!") again = input ("\nWould you want to place your order again? (Y/N): ") if again productCode 145 146 147 - == "Y": 148 input ("\nWhat is your order?\n(Enter the product code): ") = 149 - else: 150 quit() 151 - else: print(f"\n\n{productCode} product code not available") order = input("\nJust enter Y if you're ready to order: ") 152 153 154 - else: 155 quit()
Expert Solution
steps

Step by step

Solved in 2 steps

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