
Lesson 6-4: Nested Logic
140 | Chapter 6
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Rewrite your solution to Lesson 6-2, Exercise 4, so that the processing is repeated
until a negative digit is read. That is, embed your solution within another loop that continues to
prompt for a digit and calculates the sum of the digits from zero through digit as long as digit
is positive. The process stops when digit is negative. Be sure to add this information to the
prompt. Rewrite the program documentation at the beginning of the program to reflect this
change. Run your ...