Just adding in for interests here.
I'm more of an idiot! when running your app so I'll point out some tips.
Firstly you already declaring your firstnumber and secondnumber in the header file so I would suggest you remove the declaring in the main file.
Already done here in the header below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include "stdafx.h"
#include <iostream>
int Answer;
int Symbol;
int FirstNumber;
int SecondNumber;
int ReadNumber()
{
using namespace std;
cout << "What is the number you would like to input? ";
int x;
cin >> x;
return x;
}
|
Now remove the declaring in the main file and stop confusing the program which numbers to use.
1 2 3 4 5 6 7 8 9 10 11 12
|
int main()
{
using namespace std;
int FirstNumber = ReadNumber(); //<----------------------------------- remove int
int SecondNumber = ReadNumber(); //<----------------------------------- remove int
ReadFunction();
WriteAnswer();
cin.clear();
cin.ignore(255, '\n');
cin.get();
return 0;
}
|
"the user will never know what to input unless they have and idea.
if the user is to input a symbol ask and give and example" My instructor use to say.
example.
(Not much informative on what your app does);
What is the number you would like to input?
What is the function you would like to input?
Change to something like.
Please input the first number
Please input the second number
Try Asking for the first number then the symbol then the last number like you would do in a normal calculator else do as below to make it more simple.
Try making a menu for the user to choose the option to perform. You can put the main program in a loop so a the user can keep using the calculator instead of having to re-open the app.
1. divide
2. multiply
3.... makes it simple for the user to input a digit rater than a symbol
and in your switch case you can just use the number to check which operation must run. then before the switch case closes add a clear screen function and re-display your menu.
Lastly remove stdafx inclusion in the main as its included in the header.☺☺ tips and help as you asked. would like to see your code once done