Question: Help on C++ Create four functions for addition, subtraction, multiplication, and division that each accept two double values as operands and return the result. Each

Help on C++

Create four functions for addition, subtraction, multiplication, and division that each accept two double values as operands and return the result. Each function will perform its operation using the operands. Example: Operation is addition, first operand is 3.5, second operand is 7.2, the addition function should return 10.7. Create a fifth function Display_Result that takes 4 parameters, two doubles for the operands, a char for the operator, and a double for the result, and display the equation with result nicely. Note: This function should have a return type of void and does not do any math or care about what the result is or its accuracy (the math functions handle that) it just prints the equation. For example, if passed 2, 3.1, *, 6.2 then it would print 2 * 3.1 = 6.2. In main ask the user to enter the two operands (decimal values). Have the user select an operation to perform on the array by typing +, - , * or /. Call the selected function for the given operator passing it the user-selected values, and then pass the result along with the operator and operands to the print function to print the results.

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!