Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Nooblet
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
         User Info     Contact     Gamer ID
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
    Gamer IDs

    PSN ID: Sephisel

    Default First C++ PROGRAM.. not a Hello one!

    Well Here is the fruit of the second day of learning c++.
    It is a simple calculator.
    PLEASE try it and tell what you think for 2 day learner.
    download it here.

    http://ifile.it/trwmbxu


    please check out the credits on the program.
    Hope you guys like it.
    THANKS.
    :w00t::w00t::w00t::w00t: /
    :w00t:Sephisel
    :w00t::w00t::w00t::w00t:

    0 Not allowed! Not allowed!
    Last edited by sephisel; 01-07-2011 at 05:40 PM.

  2. #2
    Robot Universe Owner
    Creator of DarkFrost
    demon450's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
         User Info     Contact     Gamer ID
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
    Gamer IDs

    Gamertag: Medius450 PSN ID: Medius1337

    Contact info:

    Youtube Channel: http://www.youtube.com/user/Roceso1337

    Default

    to exit put
    Code:
    end:
    at the end of the main fnc, and say
    Code:
    goto end;
    when you want it to exit
    and would you mind if i critique the source?

    0 Not allowed! Not allowed!
    Check out Darkfrost
    Check out Robot Universe






  3. #3
    Nooblet
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
         User Info     Contact     Gamer ID
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
    Gamer IDs

    PSN ID: Sephisel

    Default

    Quote Originally Posted by demon450 View Post
    to exit put
    Code:
    end:
    at the end of the main fnc, and say
    Code:
    goto end;
    when you want it to exit
    and would you mind if i critique the source?
    Well i know how to exit the program, I just didn't want people to exit.

    And what do you mean by critizicing (dunno if I spell it right) my source?
    do you want the source code?
    ???
    I'm noob still.. ok
    lol
    yeah sure why not

    0 Not allowed! Not allowed!

  4. #4
    Robot Universe Owner
    Creator of DarkFrost
    demon450's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
         User Info     Contact     Gamer ID
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
    Gamer IDs

    Gamertag: Medius450 PSN ID: Medius1337

    Contact info:

    Youtube Channel: http://www.youtube.com/user/Roceso1337

    Default

    yes have the source, to help you if you did anything noobish i can help you or if you made an error :P

    0 Not allowed! Not allowed!
    Check out Darkfrost
    Check out Robot Universe






  5. #5
    Nooblet
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
         User Info     Contact     Gamer ID
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
    Gamer IDs

    PSN ID: Sephisel

    Default

    ok...
    here you go.
    #include <cstdlib>
    #include <iostream>

    using namespace std;

    int main(int argc, char *argv[])
    {


    welcome:;
    int a;
    system("CLS");
    cout << "Welcome to (The Calculator)\n";
    cout << "1) Multiply\n";
    cout << "2) Divide\n";
    cout << "3) Add\n";
    cout << "4) Subtract\n";
    cout << "5) Credits\n";
    cout << "Enter Your choice\n";
    cin >> a;

    switch (a)
    { case 1: goto Multiply;
    case 2: goto Division;
    case 3: goto Addition;
    case 4: goto Subtraction;
    case 5: goto Credits;
    default: goto noob;}

    Credits:;
    system("CLS");
    int k;
    cout << " WELL..... The program was simple, but helpful\n";
    cout << "//////////////////////////\n";
    cout << "//Created by Sephisel.////\n";
    cout << "//////////////////////////\n";
    cout << "Please note that the program will not let you get out, Why?... Well I'll force you to stay in it even if you don't like it. Just click the x thingy.... or.....\n";
    cout << "make it interesting, and smash your monitor till you don't get signal.\n";
    cout << "!!!!!!!!!PLEASE NOTE!!!!!!!!!!!\n";
    cout << "No matter what your intellectual level or capacity is; please do not smash your screen. That would be pretty stupid.\n";
    cout << "Do you wish to continue?\n";
    cout << "1) yes\n";
    cout << "2) no\n";
    cin >> k;
    switch (k)
    { case 1: goto welcome;
    case 2: cout << "Thank you, Please come back again\n";
    system("PAUSE");
    default : goto noob;}

    noob:;
    system("CLS");
    cout << "Incorrect input!!!!!!\n";
    cout << "Please type in the correct option number\n";
    cout << "DAMN NOOB!!!!\n";
    cout << "Now you won't get out until you hit the x thingy!!!\n";
    cout << "HAHAHAHAHAHAHA............DAMN NOOB!!!!\n";
    system("PAUSE");
    goto welcome;


    Multiply:;
    system("CLS");
    int b[3];
    int x;
    cout << "Then Multiplication it is.\n";
    cout << "Please enter first digit\n";
    cin >> b[0];
    cout << "Please enter second digit\n";
    cin >> b[1];
    b[2] = b[0] * b[1];
    cout << "Your final result is\n" << b[2];
    cout << endl;
    cout << "Do you wish to continue?\n";
    cout << "1) yes\n";
    cout << "2) no\n";
    cin >> x;

    switch (x)
    { case 1: goto welcome;
    case 2: cout << "Thank you, Please come back again\n";
    system("PAUSE");
    default : goto noob;}

    Division:;
    system("CLS");
    int c[3];
    int z;
    cout << "Then Division it is.\n";
    cout << "Please enter first digit\n";
    cin >> c[0];
    cout << "Please enter second digit\n";
    cin >> c[1];
    c[2] = c[0] / c[1];
    cout << "Your final result is\n" << c[2];
    cout << endl;
    cout << "Do you wish to continue?\n";
    cout << "1) yes\n";
    cout << "2) No\n";
    cin >> z;

    switch (z)
    { case 1: goto welcome;
    case 2: cout << "Thank you, Please come back again\n";
    system("PAUSE");
    default : goto noob;}

    Addition:;
    system("CLS");
    int d[3];
    int n;
    cout << "Then Addition it is.\n";
    cout << "Please enter first digit\n";
    cin >> d[0];
    cout << "Please enter second digit\n";
    cin >> d[1];
    d[2] = d[0] + d[1];
    cout << "Your final result is\n" << d[2];
    cout << endl;
    cout << "Do you wish to continue\n";
    cout << "1) yes\n";
    cout << "2) No\n";
    cin >> n;
    switch
    { case 1: goto welcome;
    case 2: cout << "Thank you, Please come back again\n";
    system("PAUSE");
    default : goto noob;}

    Subtraction:;
    system("CLS");
    int f[3];
    int m;
    cout << "Then Subtraction it is.\n";
    cout << "Please enter first digit\n";
    cin >> f[0];
    cout << "Please enter second digit\n";
    cin >> f[1];
    f[2] = f[0] - f[1];
    cout << "Your final result is\n" << f[2];
    cout << endl;
    cout << "Do you wish to continue\n";
    cout << "1) yes\n";
    cout << "2) No\n";
    cin >> m;
    switch (m)
    { case 1: goto welcome;
    case 2: cout << "Thank you, Please come back again\n";
    system("PAUSE");
    default : goto noob;}

    }




    Shit man, way too long for the website.
    you asked for it.
    Sephisel

    0 Not allowed! Not allowed!
    Last edited by sephisel; 01-07-2011 at 05:54 PM.

  6. #6
    Robot Universe Owner
    Creator of DarkFrost
    demon450's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
         User Info     Contact     Gamer ID
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
    Gamer IDs

    Gamertag: Medius450 PSN ID: Medius1337

    Contact info:

    Youtube Channel: http://www.youtube.com/user/Roceso1337

    Default

    lol i meant uploaded like you did while it was uploaded in the .c, i guess this is ok though, but what i like to do instead of cout is use puts(char string); also i use if statemeants for different menus but this works too, good job
    also careful what you name your variables, its easy to forget what the array of d[] does, but not of integer[] or firstNo & secondNo

    0 Not allowed! Not allowed!
    Check out Darkfrost
    Check out Robot Universe






  7. #7
    Nooblet
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
         User Info     Contact     Gamer ID
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
    Gamer IDs

    PSN ID: Sephisel

    Default

    LOL...
    sorry. I don't think anyone would take a simple code like this.
    thanks for the comments demon.
    By any chance do you know how to code 3d games with c++?
    That would be really cool!


    Just curiosity:
    Isn't the goto command supposed to be bad?
    supposedly it makes the code harder to read or something of that nature.
    I read it somewhere, but didn't know if it was truth

    0 Not allowed! Not allowed!
    Last edited by sephisel; 01-07-2011 at 06:08 PM.

  8. #8
    Robot Universe Owner
    Creator of DarkFrost
    demon450's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
         User Info     Contact     Gamer ID
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
    Gamer IDs

    Gamertag: Medius450 PSN ID: Medius1337

    Contact info:

    Youtube Channel: http://www.youtube.com/user/Roceso1337

    Default

    it doesnt really matter of the goto, just make a fnc that ends the program and call it if you dont like it, and yes i do, but the HARRDDD way from scratch,very hard though, i would sugggest you get a little better first, people dont make 3D games as there second program :P

    0 Not allowed! Not allowed!
    Check out Darkfrost
    Check out Robot Universe






  9. #9
    1337/PWNR
    Programmer
    Emu's Avatar
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
         User Info     Contact     Gamer ID
    Join Date
    Aug 2010
    Location
    Virginia
    Posts
    161
    Points
    292
    Gamer IDs

    Gamertag: SpidermaN EaT PSN ID: Shaq23Jordan

    Contact info:

    Youtube Channel: www.youtube.com/eemuohg Kik Username: ShaqGlizzy

    Default

    Good job dood, try making some formulas for the pathagorean theorem or something.

    0 Not allowed! Not allowed!

  10. #10
    Nooblet
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
         User Info     Contact     Gamer ID
    Join Date
    Mar 2010
    Location
    3ds max
    Posts
    12
    Points
    31
    Gamer IDs

    PSN ID: Sephisel

    Default

    Quote Originally Posted by demon450 View Post
    and yes i do, but the HARRDDD way from scratch,very hard though, i would sugggest you get a little better first, people dont make 3D games as there second program :P
    Well, could please spare some knowledge on at least the type of commands used to make the 3d games. Don't worry if it is the second one, the only way to get better is by trying and practicing. So, could you show me how to start a 3d game? Please...
    thanks.
    Sephisel

    0 Not allowed! Not allowed!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 01:17 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.