Following is a problem statement. Which of the below algorithms should be used to solve the problem statement? Write a program that allows the user to enter the age of a mother and her daughter in years. Calculate the sum of their age, the difference in their age and the product of their age. Show the output on the screen. Select one: a. AgeCalculation display “Provide the first number” enter number1 display “Provide the second number” enter number2 sum = number1 + number2 difference = number1 – number2 product = number1 * number2 display “The sum is “, sum display “The difference is ”, difference display “The product is “, product end b. AgeCalculations display “Provide the age of the mother” enter motherAge display “Provide the age of the daughter” enter daughterAge sum = motherAge + daughterAge difference = motherAge – daughterAge product = motherAge * daughterAge display “The sum is “, sum display “The difference is ”, difference display “The product is “, product end c. AgeCalculations enter motherAge enter daughterAge sum = motherAge + daughterAge difference = motherAge – daughterAge product = motherAge / daughterAge display sum, difference, product end d. AgeCalculations display “Provide the age of the mother” enter motherAge display “Provide the age of the daughter” enter daughterAge sum = motherAge + daughterAge difference = motherAge – daughterAge product = motherAge / daughterAge display “The sum is “, sum display “The difference is ”, difference display “The product is “, product end
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Following is a problem statement. Which of the below
Write a program that allows the user to enter the age of a mother and her daughter in years. Calculate the sum of their age, the difference in their age and the product of their age. Show the output on the screen.
display “Provide the first number”
enter number1
display “Provide the second number”
enter number2
sum = number1 + number2
difference = number1 – number2
product = number1 * number2
display “The sum is “, sum
display “The difference is ”, difference
display “The product is “, product
end
display “Provide the age of the mother”
enter motherAge
display “Provide the age of the daughter”
enter daughterAge
sum = motherAge + daughterAge
difference = motherAge – daughterAge
product = motherAge * daughterAge
display “The sum is “, sum
display “The difference is ”, difference
display “The product is “, product
end
enter motherAge
enter daughterAge
sum = motherAge + daughterAge
difference = motherAge – daughterAge
product = motherAge / daughterAge
display sum, difference, product
end
display “Provide the age of the mother”
enter motherAge
display “Provide the age of the daughter”
enter daughterAge
sum = motherAge + daughterAge
difference = motherAge – daughterAge
product = motherAge / daughterAge
display “The sum is “, sum
display “The difference is ”, difference
display “The product is “, product
end
Step by step
Solved in 5 steps with 2 images