Made a simple little code as a project for my "teacher".
It's a simple calculator.
C.C and suggestions would be helpful. Thanks alot guys.Code:#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char response;
int num1;
int num2;
cout << "Welcome to Jose's C++ Calculator.\n";
cout << "Please enter the first number of you problem:\n";
cin >> num1;
cout << endl;
cout << "You can now pick either +, -, /, or x.\n";
cout << "Now enter the operation that you'd like to perform:\n";
cin >> response;
cout << endl;
cout << "Now please enter the second number of your problem:\n";
cin >> num2;
cout << endl;
if (response == '+'){
cout << num1 << " + " << num2 << " = " << num1+num2 << endl ;
};
if (response == '-'){
cout << num1 << " - " << num2 << " = " << num1-num2 << endl ;
};
if (response == 'x'){
cout << num1 << " x " << num2 << " = " << num1*num2 << endl ;
};
if (response == '/'){
cout << num1 << " / " << num2 << " = " << num1/num2 << endl ;
};
cout << "Type anything and press enter to exit." << endl;
char f;
cin >> f;
return 0;
}
~Joser

