1. Sum = 0
2. Count = 0
3. Display prompt user
3. Read number
4. While more numbers do
a. Sum = sum + number
b. Count = count + 1
c. Display prompt to user
d. Read number
6. If count = 0 then
b. Display message “ unable to calculate average since no numbers were entered
else
c. Average = sum / count
d. Display average
Answers
Answered by
0
While more numbers do a. Sum = sum + number b. Count = count + 1 c. Display prompt to user d.
Answered by
1
First make a double variable in which the number is saved. Then divide that number by 10 in a loop to make the number continuously lose a digit, until it is a 1-digit number. cast the double variable to int to round it down. The result will then be the previously first decimal digit.
To count the number of digits in a number we have to divide that number by 10 until it becomes 0 or less than 0. If you divide any number by 10 and store the result in an integer then it strips the last digit.
hope it helps you..
Similar questions
Social Sciences,
5 months ago
Chemistry,
5 months ago
Math,
10 months ago
Computer Science,
10 months ago
English,
1 year ago
Math,
1 year ago