Ok, so I am having some trouble with my calculator code. The two issues I am having are:
1. I cant get my program to produce decimals, I have tried using "float" but that didn't work so i don't know how to fix that.
2. I don't know how to make my program go to the beginning and I am trying to find out how but i couldn't. And i know that GOTO is basically forbidden to please help. Here is my source code.
#include <iostream>
using namespace std;
int main()
{
int choice;
int a;
int b;
cout<<"Hello! Welcome to kiwimoosical's calculator\n";
cout<<"1. Addition\n";
cout<<"2. Subtraction\n";
cout<<"3. Multiplication\n";
cout<<"4. Division\n";
cin >> choice;
switch(choice)
{
case 1: cout<<"Enter two numbers, one at a time to be added together.";
cin >> a;
cin >> b;
return a+b;
break;
case 2: cout<<"Enter two numbers, one at a time to be subtracted.";
cin >> a;
cin >> b;
return a-b;
break;
case 3: cout<<"Enter two numbers, one at a time to be multiplied together.";
cin >> a;
cin >> b;
return a*b;
break;
case 4: cout<<"Enter two numbers, one at a time to be divided by.";
cin >> a;
cin >> b;
return a/b;
break;
}
}