Hi,
I'm trying to make make myself a calculator, very simple one.
Code:
#include <iostream>
using namespace std;
int main()
cout << "Please enter the first number ";
cin >> numberone;
cin.ignore();
cout << "Please enter the second number ";
cin >> numbertwo;
cin.ignore();
cout "Please enter whether you wish to add (+), subtract (-), mulitiply (*) or divide (/) ";
cin >> type;
cin.ignore();
My plan is to use the variable 'type' to store the calculation type ( +,-,*,/) but am unsure of what to use to perform the calculation.
A Switch was my initial plan, but from what I know, the syntax requires either an integer or a char to be contained in the "switch ( this bit ) { ... ]"
I need a recommendation on what to use, if not a Switch.
Hope that makes sense.
Thanks!