PDA

View Full Version : Learning c++ -> Beta Proggy


Mr. Hasselhoff
06-02-2006, 09:38 PM
Well as I go I try to do projects that use all the elements that I just read about. I just started the book, and only the first option works so far (multiplication).
23
Source Code:
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
int answer;
cout << "Welcome to Yuri's application, please select your choice." << endl;
cout << " \* \t (1) Multiplication." << endl;
cout << " \* \t (2) Division." << endl;
cout << " \* \t (3) Addition." << endl;
cout << " \* \t (4) Subtraction." << endl;
int option1 = 1;
int second;
cin >> second;
string result;
result = option1 == second ? "Please input your first digit." : "Thank you for using my program.";
cout << result << endl;
int numberone, numbertwo;
cin >> numberone;
cout << "And your second number please." << endl;
cin >> numbertwo;
answer = numberone * numbertwo;
cout << numberone << " * " << numbertwo << " = " << answer << endl;




system("PAUSE");
return EXIT_SUCCESS;
}

*CCCP*
06-03-2006, 12:15 AM
Cool, but all of the options multiply...

Mr. Hasselhoff
06-03-2006, 12:19 AM
I know I said there was only one option, since I haven't gotten to the "goto" statements its a pain in da ass lol

*CCCP*
06-03-2006, 12:55 AM
Nice work anyway

tom_beach22
06-03-2006, 02:36 AM
its better than anyhting i make.

karr
09-18-2006, 04:47 PM
yup