so im taking the advice of 1ML, seems like a smart guy, and starting a second thread for the controversial, main calling, system calling, devil code, anyway i did take your guys advice and cut out the main calls and reduce everything to one fuction. however! ladies and gentlemen we still have a few problems, among them....
-my arithmetic statments dont return the correct answer(yes i used proper symbols i promise)
-if i cant call main, how do i make it start from the top of main if they type incorrectly?(tried *main(); and &main(); also, if thats considered calling main i will not do it anymore)
-return 0; isn't closing the program without actually showing the stop code? i noticed this after switching from devc++ to code blocks, so maybe thats my issue
-lastly, more of a question, how exactly is iostream and windows.h outdated? aren't those, necessary for: text apps and windows GUI, respectively?
code is as follows
#include<iostream>
#include<windows.h>
using namespace std;
//so this is where i have just the interface, its not really "variables"
//like the one poster mentioned
//also i havent got to class yet...
int main()
{
//strings that will be used in the program
string s1;
string s2;
double d1;
double d2;
double addition = (d1 + d2);
double subtraction = (d1 - d2);
double multiplication = (d1 * d2);
double division = (d1 / d2);
do
{
cout << "What math operation would you like to perform?\n";
cin >> s1;
if((s1=="Division") || s1==("division") || (s1=="/"))
{
cout << "Enter the first number: ";
cin >> d1;
cout << "Enter the second number: ";
cin >> d2;
cout << "The answer is: " << division; //these work
cin.ignore();
cin.get();
}
else if((s1=="Addition") || (s1=="addition") || (s1=="+"))
{
cout << "Enter the first number: ";
cin >> d1;
cout << "Enter the second number: ";
cin >> d2;
cout << "The answer is: " << addition;
}
else if((s1== "Subtraction") || (s1=="subtraction") || (s1=="-"))
{
cout << "Enter the first number: ";
cin >> d1;
cout << "Enter the second number: ";
cin >> d2;
cout << "The answer is: " << subtraction;
}
else if((s1== "Multiplication" || s1=="multiplication") || (s1=="*"))
{
cout << "Enter the first number: ";
cin >> d1;
cout << "Enter the second number: ";
cin >> d2;
cout << "The answer is: " << subtraction;
}
else
{
cout << "It seems you have mistyped something, try again\n";
cin.ignore();
cin.get();
?????
}
}while((s2=="Y") || (s2=="y"));
if((s2=="N") || (s2=="n"))
{
return 0;
}
}