I have also attached a more detailed description. Instructions: Write a program that mimics a calculator. The program should take as input: Two floating-point numbers The operation to be performed (+,...

1 answer below »

I have also attached a more detailed description. Instructions:


Write a program that mimics a calculator. The program should take as input:



  1. Two floating-point numbers

  2. The operation to be performed (+, -, /, *).


It should then output the numbers, the operator, and the result.


Additional notes:



  • Format your output to two decimal places.

  • For division, if the denominator is zero, output an appropriate message. The message should contain the word "error"


Some sample outputs follow:



3.5 + 4.0 = 7.50 13.973 * 5.65 = 78.95



Instructions Write a program that mimics a calculator. The program should take as input: 1. Two floating-point numbers 2. The operation to be performed (+, -, /, *). It should then output the numbers, the operator, and the result. Additional notes: · Format your output to two decimal places. · For division, if the denominator is zero, output an appropriate message. The message should contain the word "error" Some sample outputs follow: 3.5 + 4.0 = 7.50 13.973 * 5.65 = 78.95 Here is what the run checks are looking for: Tasks 0.00 out of 10.00 Correct output for divide by 0 1 0 out of 1 checks passed. Review the results below for more details. Checks Test CaseIncomplete Divide by 0 test 1 Input 1 0 / Output Results error Show Details 0.00 out of 10.00 Correct output for happy path test cases 4 0 out of 4 checks passed. Review the results below for more details. Checks Test CaseIncomplete Division test 1 Input 90.76 5.21 / Output Results 90.76 / 5.21 = 17.42 Show Details Test CaseIncomplete Multiplication test 1 Input 5.4 9.7 * Output Results 5.40 * 9.70 = 52.38 Show Details Test CaseIncomplete Subtraction test 1 Input 67.4 32.98 - Output Results 67.40 - 32.98 = 34.42 Show Details Test CaseIncomplete Addition test 1 Input -834.2 4354.98 + Output Results -834.20 + 4354.98 = 3520.78 Show Details Run ChecksSubmit 0% This is the book being used:
Answered Same DayOct 16, 2021

Answer To: I have also attached a more detailed description. Instructions: Write a program that mimics a...

Ketaki answered on Oct 16 2021
136 Votes
#include
#include
using namespace std;
int main()
{
    float a, b, c;

    char operation;
    cout<<"Enter the first number : ";
    cin>>a;
    cout<<"n Enter the second number : ";
    cin>>b;
    cout<<"Enter Operator : + (addition) , – (subtraction) , * (multiplication), /...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here