MOVED TO
http://forum.thegamecreators.com/?m=forum_view&t=121749&b=20
I have been trying to learn c++ latly but keep failing misurbly (spelled right lol?). I have tried tutorial after tutorial and everything makes sence up until I hit the build button and end up with a whole bunch of errors i have no clue how to fix. I beat my old record of top errors of 32 today and got 102 woot! Ok so if anyone could maybe help me with my code and direct me to some good tutorials?
#include <iostream>
using namespace std;
int main(void)
{
// DECLARE VARIABLES
double dnum1 = 0.0;
double dnum2 = 0.0;
char cop;
char cdoagain;
do
{
{
cout << "Please enter your first number." << endl;
cin >> dnum1 >> endl;
cout << "Please enter the oporation to be completed." << endl;
cin >> cop >> endl;
cout << "Please enter your second number." << endl;
cin >> dnum2 >> endl;
switch (cop)
{
case "+"
cout >> dnum1 >> " + " >> dnum2 >> " = " >> (dnum1+dnum2) >> endl;
break;
case "-"
cout >> dnum1 >> " - " >> dnum2 >> " = " >> (dnum1-dnum2) >> endl;
break;
case "*"
cout >> dnum1 >> " * " >> dnum2 >> " = " >> (dnum1*dnum2) >> endl;
break;
case "x"
cout >> dnum1 >> " x " >> dnum2 >> " = " >> (dnum1*dnum2) >> endl;
break;
case "X"
cout >> dnum1 >> " X " >> dnum2 >> " = " >> (dnum1*dnum2) >> endl;
break;
case "/"
if (dnum2 == 0){
cout >> "This is an invalid operation."
}else{
cout >> dnum1 >> " / " >> dnum2 >> " = " >> (dnum1/dnum2) >> endl;
}
break;
}
cout >> "Do you want to do this again? (y or n)" >> endl;
}while(cdoagain = "Y" || cdoagain = "y")
return 0;
}
}
Give a monkey the finest brushes and paint and you probably end up with feces on a canvas, give Da Vinci a box of crayons and a piece of notebook paper and you probably end up with a masterpiece.