0

I have this question. My code is not giving the right output.

Write a basic calculator program. The program input and output should be as indicated below; Sample Input Enter the first operand: 10 Enter the arithmetic symbol: * Enter the second operand: 20 Sample Output: 10 * 20 = 200 Another Operation, Y/N? The program should allow the user to input arithmetic operators such as *, -, +, and /. If the user inputs an arithmetic symbol that is not defined then the following error message, “Error, Wrong Operator. Use defined operators *, -, +, and /.”. The program should consist of the following; class simple_calc, member variables, and member functions such as f_add(), f_sub(), f_mult(), f_div(), f_inputs(), f_outputs(), etc.

28th Sep 2022, 1:36 PM
Collins Maina
4 odpowiedzi
+ 5
Collins Maina , what kind of trouble do you have with this description? > did you made any try that you can link here? > we are also missing the programming language you are going to use.
28th Sep 2022, 2:00 PM
Lothar
Lothar - avatar
+ 1
switch statements select pieces of code depending on a value. Think if you have to select member functions from main routine or select something in each member function.
29th Sep 2022, 3:47 AM
Emerson Prado
Emerson Prado - avatar
0
Am using c++
28th Sep 2022, 7:18 PM
Collins Maina
0
For each function do you have to use a switch case or should you only have one switch case for the whole program
28th Sep 2022, 7:19 PM
Collins Maina