subject

(Calculator Using Function Pointers) Using the techniques you learned in Fig. 7.28, create a text-based, menu-driven program that
allows the user to choose whether to add, subtract, multiply or divide two numbers. The
program should then input two double values from the user, perform the appropriate
calculation and display the result. Use an array of function pointers in which each pointer
represents a function that returns void and receives two double parameters. The corresponding
functions should each display messages indicating which calculation was performed, the values
of the parameters and the result of the calculation. In both cases, display the value to 2
digits of precision.
Note: do not accept invalid menu selections, print an error message and ask the user to try
again. Furthermore, if the user chooses division but enters 0 as the divisor, do not accept the
entry, print an error message and ask the user to enter another number instead.
===·Calculator·Menu·===↵

Please·select·from·the·options·belo w:↵

(0)·Add·a·number·to·another.↵
(1)·Subtract·a·number·from·another. ↵
(2)·Multiply·a·number·to·another.↵< br /> (3)·Divide·a·number·by·another.↵

Enter·your·selection:-1↵
·Invalid·selection!↵
Enter·your·selection:3↵
·Enter·a·number:25.00↵
·Enter·another·number:0.00↵
·Error:·attempting·to·divide·by·zer o!↵
Enter·another·number:0.05↵
·Dividing·25.00·by·0.05...↵
The·result·is:·500.00↵

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
When is it appropriate to use an absolute reference
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
You know the right answer?
(Calculator Using Function Pointers) Using the techniques you learned in Fig. 7.28, create a text-b...
Questions
question
Mathematics, 01.07.2020 16:01
question
English, 01.07.2020 16:01
question
Mathematics, 01.07.2020 16:01
question
Mathematics, 01.07.2020 16:01
question
Mathematics, 01.07.2020 16:01
question
Mathematics, 01.07.2020 16:01
question
Mathematics, 01.07.2020 16:01
Questions on the website: 13722363