Question: 1) Write a function digitize (using loops) that takes two parameters: one integer parameter and one bool parameter. The function would print the integer one

1) Write a function digitize (using loops) that takes two parameters: one integer parameter and one bool parameter. The function would print the integer one digit at a time each on a separate line. If the bool parameter passed were true, the function would print the digits from the most significant digit to the least significant. Otherwise, it would print it in the reverse order (least significant to most significant).

HOW IT SHOULD PRINT

Function Call OUTPUT
digitize(1758,true)

1

7

5

8

digitize(1758,false)

8

5

7

1

2)

Write a function (without using loops) that reverses the digits in an integer and prints out the integer in this reverse form. It is not necessary to calculate the value of the reverse integer, just print out the digits in reverse order. The function should be called reverse. Remember to explain your functions, either by adding comments or using pseudocode or showing how you derived the function. State any assumptions you make and comments.

THANK YOU IN ADVANCE

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!