Question: Write a function that accepts as its input a single random number. Your function should use a while loop to repeatedly divide this number by

Write a function that accepts as its input a single random number. Your function should use a while loop to repeatedly divide this number by 7 until the value remaining is less than 1. The function should have two separate output values:
The value remaining (which should be less than 1) and
The number of divisions required.
Because the number of divisions required should be an integer, be sure to create it as an 8-bit unsigned integer type variable to avoid any potential rounding/arithmetic issues.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!