Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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:

 XXXXXXXXXX = XXXXXXXXXX * 5.65 = 78.95
Answered Same Day Oct 16, 2021

Solution

Ketaki answered on Oct 16 2021
138 Votes
#include #include
its/stdc++.h
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
;
    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