Question: A Black Jack-like program: a program that reads numbers and sums them until the total gets greater or equal to 21. The input sequence ends
A Black Jack-like program: a program that reads numbers and sums them until the total gets greater or equal to 21. The input sequence ends with 0 for the program to be able to stop even if the total sum of all numbers is less than 21.
When the total is greater or equal to 21 : print like Total sum is 24
If 0 is entered and the total is less than 21
: print like Total sum is less than 21 and is equal to 14
Test Case 1
input: 2, 4, 7, 0 output: Total sum is less than 21 and is equal to 13
Test Case 2
input: 9, 9, 5(4, 0 : actually, they can not be entered) output: Total sum
is 23
Draw a flowchart and write a Python code: Use while and else statement, break
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
