#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
float x, y;
int option;
float result;
string selection;
cout << "This program will add multiply and divide two numbers"<<endl<<endl;
cout << "Please enter two numbers separated by space:"<<endl;
cin >> x >> y;
cout << "Enter a select code"<<endl;
cout << "\t (1) for addition" << endl;
cout << "\t (2) for multiplication" << endl;
cout << "\t (3) for division" << endl;
cin >> option;
switch (option)
{
case 1: selection = "added to";
result = x + y;
break;
case 2: selection = "multipled by";
result = x*y;
break;
case 3: selection = "divided by";
result = x / y;
break;
}
cout << "The first number " << selection << " the second number is " << result << endl;
getchar();
getchar();
return 0;
}
You can use this as a guide.