Question: In this exercise you should design a flow chart for a program that: Prompts the user to enter a positive integer number. Then reads the
In this exercise you should design a flow chart for a program that: Prompts the user to enter a positive integer number. Then reads the users input. If the user input is not a positive number prompts her/him again and again until he/she enters a valid input. Then, it uses a loop to calculate the sum of the digits of the users input, and displays the sum value. For example, if the user enters the number 94311, the program should print the sum of digits: 9 + 4 + 3 + 1 + 1, which is 18. The program should end after displaying the sum.
Hint: you should use a loop and take advantage of integer division by 10 and modulus of 10. To be consistent in using the variable names please start with the given figure to the right of this box:

What to Do: start In this exercise you should design a flow chart for a program that: sum of digits 0 Prompts the user to enter a positive integer number. Then reads the user's input. If the user input is not a positive number prompts her/him again and again until he/she enters a valid input. enter an integer number Then, it uses a loop to calculate the sum of the digits of the user's input, and displays the sum value read: number For example, if the user enters the number 94311, the program should print the sum of digits: 9+4+3+ 1+1, which is 18. The program should end after displaying the sum. Hint: you should use a loop and take advantage of integer division by 10 and modulus of 10. end To be consistent in using the variable names please start with the given figure to the right of this box
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
