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 08:00
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
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
Spanish, 15.11.2019 01:31
question
Computers and Technology, 15.11.2019 01:31
question
History, 15.11.2019 01:31
question
Mathematics, 15.11.2019 01:31
question
Mathematics, 15.11.2019 01:31