# ENGR 29700 – Senkpeil Assignment #8 NOTE: Submit your assignment in a

ENGR 29700 – Senkpeil
Assignment #8

NOTE: Submit your assignment in a single script (.m) file. Add a comment to each section of your code to note what part of each problem it was written to answer. Write all of the code to complete this problem in an executive function and several user defined functions. Make sure that all of your code is present in these scripts. Do not perform any calculations in the command window that are not recreated in your scripts.

Write an executive function and several user defined functions that will perform the following actions:

Prompt the user to input an integer from 10-99. Loop until the user provides valid input

Write a loop that will determine the number of times the digits of the input value can be multiplied together before the result is less than 10

Example:

Input Value = 88

8*8 = 64 Not less than 10
6*4 = 24 Not less than 10
2*4 = 8 Less than 10 – stop loop

3 multiplications were required before the result was less than 10

Print to the screen “Starting at X, Y multiplications were required before the result reached Z” where:

X = The value input by the user
Y = The number of multiplications required before the result was less than 10
Z = The result of the final multiplication

Output Example (Assuming same data as previous example):

Starting at 88, 3 multiplications were required before the result reached 8

Test Cases:

Please enter an integer from 10 – 99: 88
Starting at 88, 3 multiplications were required before the result reached 8

Please enter an integer from 10 – 99: 2

Your original input was less than 10. Please enter an integer from 10 – 99: 150

Your original input was greater than 99. Please enter an integer from 10 – 99: 55.5

Your original input was not an integer. Please enter an integer from 10 – 99: 55

Starting at 55, 3 multiplications were required before the result reached 0

Please enter an integer from 10 – 99: 77

Starting at 77, 4 multiplications were required before the result reached 8

Please enter an integer from 10 – 99: 90

Starting at 90, 1 multiplications were required before the result reached 0

Please enter an integer from 10 – 99: 11

Starting at 11, 1 multiplications were required before the result reached 1 