Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a set of test cases manually (test code not asked) that will adequately test the while loop in the below pseudocode that counts

 

Develop a set of test cases manually (test code not asked) that will adequately test the while loop in the below pseudocode that counts the number of digits in a number and finds the sum of those digits. Text that follows two forward slashes // in below pseudocode is a comment. Flow graph is not needed. 123 3 45 //count the number of digits in a number (num) and sum the digits INPUT num digits sum = 0 6 7 8 00 9 10 11 12 13 14 15 16 11 //receive input from user and store in num //count of digits in a number //sum of digits in a number while(num > 0) begin valueOfDigit = num modulus 10 //mod num by 10 sum = sum + valueOfDigit num roundDown (num / 10) //divide num by 10 digits = digits + 1 end while print(digits) print(sum)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elements Of Chemical Reaction Engineering

Authors: H. Fogler

6th Edition

013548622X, 978-0135486221

More Books

Students also viewed these Programming questions

Question

=+b. What is Pd(2c ) when 5 4?

Answered: 1 week ago