All pastes #116891 Raw Edit

For Skylark

public text v1 · immutable
·published 2006-08-05 14:20 UTC
rendered paste body

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int Calc, char* pszArgs[])
{

int int1;
int int2;
double double1;
double double2;
int answer;
double answer1;
string command;
bool b = true;
string x1;       
while(b = true)
{
        // Prompts user for mathematical operator and assigns it to 'op'
        cout << "Welcome To BlackJack's Calculator\n\nPlease Enter a Mathematical Operator\n"
             << "Type |Exit| To Exit The Program.\n"
             << "Type |History| To See A History Of Recent Operations.\n";
        cout << "\nx - Multiplacation\n/ - Division\n+ - Addition\n- - Subtraction\n";
        string op;
        cin >> op;     
        
        if(op == "Exit")
        {
        return 0;
        }
        
    
        else if(op == "x")
        {
        cout << "You Have Chosen Multiplacation\nPlease Enter 2 Numbers To Multiply\n";
        cin  >> int1 >> int2;
        answer = int1 * int2;
        x1 = "The Product of "int1" and "int2" is "answer;
        sprintf
        cout << x1;
        cout << "The Product of " << int1 << " and " << int2 << " is " << answer << "\n\n" 
                       << "Press a Key To Continue Multiplacation\n"
                       << "Type |Main| Return To Main Menu\nType |Exit| To Exit\n";
        cin >> command;
        system("cls");
        if(command == "Exit")
        {
        return 0;
        }
        else if(command == "Main")
        {
        continue;
        }
        } 
   
        else if(op == "/")
        {
        cout << "You Have Chosen Division\nPlease Enter A Numerator Followed By a Divisor\n";
        cin  >> double1 >> double2;
        answer1 = double1 / double2;
        cout << answer1 << "\n\n" << "Press a key to continue division\n"
                        << "Type |Main| Return To Main Menu\nType |Exit| To Exit\n";
        cin  >> command;
        system("cls");
        if(command == "Exit")
        {
        return 0;
        }
        else if(command == "Main")
        {
        continue;
        }
        } 
       
        else if(op == "+")
        {
        cout << "You Have Chosen Addition\nPlease Enter 2 Numbers To Add\n";
        cin  >> double1 >> double2;
        answer1 = double1 / double2;
        cout << answer1 << "\n\n" << "Press A Key To Continue Addition\n"
                        << "Type |Main| To Return To Main Menu\nType |Exit| To Exit\n";
        cin  >> command;
        system("cls");
        if(command == "Exit")
        {
        return 0;
        }
        else if(command == "Main")
        {
        continue;
        }
        }
        else if(op == "-")
        {
        cout << "You Have Chosen Subtraction\nPlease Enter A Subtractee and A Subtractor\n";
        cin  >> int1 >> int2;
        answer = int1 - int2 ;
        cout << answer1 << "\n\n" << "Press A Key To Continue Subtraction\n"
                        << "Type |Main| To Return To Main Menu\nType |Exit| To Exit\n";
        cin  >> command;
        system("cls");
        if(command == "Exit")
        {
        return 0;
        }
        else if(command == "Main")
        {
        continue;
        }
        } 
        
        
}
}