Welcome to Xenon GunZ forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Xenon GunZ

New forum !! http://www.xenongunz.co.cc/forum/upload/index.php

3 posters

    Snoozers calculator v1.2

    avatar
    Achilles


    Posts : 23
    Join date : 2010-04-24

    Snoozers calculator v1.2 Empty Snoozers calculator v1.2

    Post by Achilles Mon Apr 26, 2010 7:18 pm

    Mohahaha, I was bored so i played around with C++, and made this little calculator. (Btw Snoozer = Me)

    It contains
    -Add
    -Subtract
    -Divide
    -Multiply
    -Square root
    -Exponentiation


    Any suggestions?
    -Post em plox so i can improve this lil thing ;D!

    Download here: http://easy-upload.nl/f/d1iyuyBe

    For anyone who's interested, here's the source code~
    Code:
    #include <iostream>
    #include <string>
    #include <math.h>

    using namespace std;

    int main()
    {
        float a;
        float b;
              float s;
        string choice;
        string cont;
        string zchoice;
       
        cout << "\nHello peoplez.\nMy name is Snoozer's Calculator V1.2\n";
        cout << "So, How can i help you today?\n\nType \"A\" for Add.";
        cout << "\nType \"S\" for Subtract.\nType \"M\" for Multiply\n";
        cout << "Type \"D\" for Divide\nType \"R\" for Square Root\nType \"E\" for Exponentiation\n";
        cin >> choice;
       
        if (choice == "A")
        {
                  cout << "\nYou chose Add, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the first number:\n";
                        cin >> a;
                        cout << "Now type the second number:\n";
                        cin >> b;
                        cout << "    " << a << " + " << b << " = " << a+b << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
        }


        if (choice == "S")
        {
                  cout << "\nYou chose Subtract, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the first number:\n";
                        cin >> a;
                        cout << "Now type the second number:\n";
                        cin >> b;
                        cout << "    " << a << " - " << b << " = " << a-b << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
        }


        if (choice == "M")
        {
                  cout << "\nYou chose Multiply, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the first number:\n";
                        cin >> a;
                        cout << "Now type the second number:\n";
                        cin >> b;
                        cout << "    " << a << " * " << b << " = " << a*b << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
        }


        if (choice == "D")
        {
                  cout << "\nYou chose Divine, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the first number:\n";
                        cin >> a;
                        cout << "Now type the second number:\n";
                        cin >> b;
                        cout << "    " << a << " / " << b << " = " << a/b << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
        }
       
        if (choice == "R")
        {
                  cout << "\nYou chose Square root, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the number:\n";
                        cin >> a;
                        cout << "Ther square root out " << a << " Is " << sqrt(a) << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
     }
     
     if (choice == "E")
        {
                  cout << "\nYou chose Exponentiation, is this correct? Type: Yes/No\n";
                  cin >> zchoice;
                 
                  if (zchoice == "No")
                  {
                              main ();
                  }
                 
                  else (zchoice == "Yes");
                  {
                        cout << "\nOk good!\nPlease type in the number:\n";
                        cin >> a;
                        cout << "Now type the Exponent:\n";
                        cin >> b;
                        cout << "    " << a << " ^ " << b << " = " << pow(a, b) << endl;
                        cout << "\n";
                        cout << "Would you like to continue? Type: Yes/No\n";
                        cin >> cont;
                                if (cont == "Yes")
                                {
                                        main ();
                                }
                       
                                  else (cont == "No");
                                  {
                                  return 0;
                                  }
                  }
        }

    char f;
    cin >> f;
    return 0;
    }
    avatar
    Streamline[Owner]
    Admin


    Posts : 48
    Join date : 2010-04-23
    Age : 33
    Location : Home

    Snoozers calculator v1.2 Empty Re: Snoozers calculator v1.2

    Post by Streamline[Owner] Mon Apr 26, 2010 7:21 pm

    very nice Very Happy

    9/10 ! Razz
    avatar
    Achilles


    Posts : 23
    Join date : 2010-04-24

    Snoozers calculator v1.2 Empty Re: Snoozers calculator v1.2

    Post by Achilles Mon Apr 26, 2010 7:23 pm

    hehe thx xD
    Epic
    Epic


    Posts : 9
    Join date : 2010-04-23

    Snoozers calculator v1.2 Empty Re: Snoozers calculator v1.2

    Post by Epic Mon Apr 26, 2010 8:08 pm

    Lol, I didn't know you did c++
    avatar
    Achilles


    Posts : 23
    Join date : 2010-04-24

    Snoozers calculator v1.2 Empty Re: Snoozers calculator v1.2

    Post by Achilles Mon Apr 26, 2010 8:11 pm

    Theres lots of things you dont know ^^

    Sponsored content


    Snoozers calculator v1.2 Empty Re: Snoozers calculator v1.2

    Post by Sponsored content


      Current date/time is Sun May 19, 2024 3:55 pm