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;
}
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;
}