Question: As you probably have noticed. your source code for Marcus from Chapters 7 and 8 is getting more than a little messy. Break the solution



As you probably have noticed. your source code for Marcus from Chapters 7 and 8 is getting more than a little messy. Break the solution you previously created into the following functions. - Name: GetData - Parameters: none - Return: The integer number entered by the user. - Purpose: This function would allow the user to enter the number to be tested. Marcus would like you to limit the input from negative one million to positive one million. If the number entered is out of bounds, display an error message and have the user re-enter the value. - Name: DisplayMenu - Parameters: - The variable that holds the menu choice. Pass by reference. - Return: none - Purpose: This function displays the menu to the user. - Name: ProcessMenuChoice - Parameters: - The variable that holds the menu choice. Pass by value. - The variable that holds the number entered. Pass by reference. - Return: none - Purpose: This function will call the appropriate function based upon the menu choice that is passed in. - Name: IsPosNeg - Parameters: - The variable that holds the number entered. Pass by value. - Return: none - Purpose: This function tests the number that is passed to determine whether it is positive, negative or zero. The function displays an appropriate message base upon the results of the test. - Name: IsOddEven - Parameters: - The variable that holds the number entered. Pass by value. - Return: none - Purpose: This function tests the number that is passed to determine whether it is odd, even or zero. The function displays an appropriate message based upon the results of the test. - Name: FindNumDigits - Parameters: - The variable that holds the number entered. Pass by value. - Return: The number of digits. - Purpose: This function determines the number of digits in the number that is passed in. - Name: FindDigitAtPosition - Parameters: - The variable that holds the number entered. Pass by value. - The variable that contains the digit's position. Pass by value. - Return: The digit at the specified position - Purpose: This function determines what digit is at a specific position in the number. - Name: DisplayAdditionTable - Parameters: none - Return: none - Purpose: This function displays the addition table. - Name: DisplayMultiplication Table - Parameters: none - Return: none - Purpose: This function displays the multiplication table. Both of the FindNumDigits and FindDigitAtPosition functions return a value, which is then displayed in the ProcessMenuChoice function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
