functions. Write a program that calculates multiplication and division operations through The function that calculates multiplication...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
functions. Write a program that calculates multiplication and division operations through 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+3=3 3+3-6 6+3-9 repeats 4 times because multiplier is 4. 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. 7-2=5 5-2=3 3-2-1 remainder value repeated 3 times division result is 3. 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:7 2 Enter the operation character:/ Result of the division is 3 and the remainder is 1 Sample Run 3: Enter two integer values:3 5 Enter the operation character:t Error! Undefined operation. functions. Write a program that calculates multiplication and division operations through 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+3=3 3+3-6 6+3-9 repeats 4 times because multiplier is 4. 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. 7-2=5 5-2=3 3-2-1 remainder value repeated 3 times division result is 3. 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:7 2 Enter the operation character:/ Result of the division is 3 and the remainder is 1 Sample Run 3: Enter two integer values:3 5 Enter the operation character:t Error! Undefined operation.
Expert Answer:
Answer rating: 100% (QA)
code include void multiplicationint a int b function to print the multiplication of two numbers int ... View the full answer
Related Book For
An Introduction to the Mathematics of Financial Derivatives
ISBN: 978-0123846822
3rd edition
Authors: Ali Hirsa, Salih N. Neftci
Posted Date:
Students also viewed these programming questions
-
An algorithm has been written in pseudocode to input some numbers. It only outputs any numbers that are greater than or equal to 100. The number 999 is not output and stops the algorithm. INPUT...
-
How would you help a person understand domestic violence if she was from a culture that considered male dominance and female submission as part of their beliefs?
-
A friend tells you that she has tender, swollen "glands" along the left side of the front of her neck. You notice that she has a bandage on her left cheek that is not fully hiding a large infected...
-
Delta Company produces a single product. The cost of producing and selling a single unit of this product at the companys normal activity level of 60,000 units per year is: The normal selling price is...
-
Describe and illustrate the differences among design defects, manufacturing defects, inadequate warnings and labels (marketing defects), and breach of express and implied warranties.
-
Fiduciary Financial Statements Ray County administers a tax agency fund, an investment trust fund, and a private-purpose trust fund. The tax agency fund acts as an agent for the county, a city within...
-
which muscle were use to extend and splay your finger outward?
-
From the adjustments columns in Exercise 5-9A, journalize the four adjusting entries, as of December 31, in proper general journal format. Exercise 5-9A Jim Jacobs Furniture Repair Work Sheet...
-
Categorize the compounds below as meso or non-meso species. Y 10th attempt Items (6 images) (Drag and drop into the appropriate area below) Br X.X.X. Br Br Categories Br Meso Compounds Drag and drop...
-
Operations department in an organization is an example of Permanent teams Work teams Temporary teams Committees
-
The efficiency of the rank correlation test is 0.91. What does that value tell us about the test?
-
What do you think will be the consequences of your coworkers actions?
-
Determine whether the following statement is true or false: When testing a claim about the means of two independent populations, the alternative hypothesis can never contain the condition of equality.
-
Determine whether the following statement is true or false: When using the methods of this chapter to test a claim that two population proportions are equal, each of the two samples must satisfy the...
-
A box of area (20000 + 32) mm 2 is subjected to an axial load of 20KN. Determine the normal and shear stress on a section which is inclined at an angle of 45 o with normal cross-section of the box.
-
Parkin Industries, a U.S. company, acquired a wholly-owned subsidiary, located in Italy, at the beginning of the current year, for 200,000. The subsidiary's functional currency is the euro. The...
-
Plot the payoff diagrams for the following instruments: (a) A caplet with cap rate Rcap = 6.75% written on 3-month Libor Lt that is about to expire. (b) A forward contract written on a default free...
-
Suppose the bond price B(t, T) satisfies the following PDE: Define the variable V(u) as where s is the market price of interest rate risk. (a) Let B(t, T) be the bond price. Calculate the d(BV). (b)...
-
Assume that the return R t of a stock has the following log-normal distribution for fixed t: log (Rt) N(, 2 ) Suppose we let the density of log(R t ) be denoted by f (R t ) and hypothesize that =...
-
A burst of compressed air pushes a pellet out of a blowpipe. The force exerted by the air on the pellet is given by \(F(t)=F_{0} e^{-t / \tau}\), where \(\tau\) is called a time constant because it...
-
Thrust is the force that pushes a rocket forward. It is a force exerted on the rocket as the engine expels hot gases from the rear of the rocket. For most rockets, thrust is variable rather than...
-
Assume you want to use random tests on an FIR filter program. How would you know when the program under test is executing correctly?
Study smarter with the SolutionInn App