Question: Question: Write a program that calculates multiplication and division operations through functions. The function that calculates multiplication takes 2 positive integer numbers as parameters and

 Question: Write a program that calculates multiplication and division operations through
functions. The function that calculates multiplication takes 2 positive integer numbers as

Question: Write a program that calculates multiplication and division operations through functions. The function that calculates multiplication takes 2 positive integer numbers as parameters and display the result of the multiplication. One of the parameters is the multiplicand and the other one is the multiplier. This function calculates the result of the multiplication by calculating the sum of the multiplicand value multiplier value times. E.g: Let's say the function is about to calculate the multiplication of 3 and 4. 0+33 3+3-6 repeats 4 times because multiplier is 4. 6+3 -9 9+3-12 result The function that calculates division takes 2 positive integer numbers as parameters. One of the parameters is the numerator and the other one is the denominator. In this function subtract the denominator value from the numerator value until the numerator value is less than the denominator value and count how many times these operations happens. Then display the count as the result of the division and the newly calculated numerator value as the remainder value of the division as in the Sample Run 2. E. g: Let's say the function is about to calculate the division of 7 to 2. repeated 3 times division result is 3. 7-2-5 5-2-3 3-2-1 remainder value In the main function get two integer value and a character value from the user as in the sample runs and call the desired function. If the character value is it calls the multiplication function with sending its integer parameters to this function and display the result as in the Sample Run 1. If the character value is ', it calls the division function with sending its integer parameters to this function. If the character value is none of them displays an error message as in the Sample Run 3. Sample Run 1: Enter two integer values:3 4 Enter the operation character: Result of the multiplication is 12 Sample Run 2: Enter two integer values: 2 Enter the operation character:/ Result of the division is 3 and the remainder is 1 Sample Run 3: Enter two integer values:35 Enter the operation character:t Error! Undefined operation

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!