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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started