Results 1 to 12 of 12
  1. #1
    KABLE's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    California
    Posts
    2,863
    Reputation
    192
    Thanks
    282
    My Mood
    Pensive

    First Basic Calc.

    Code:
    //This is practice using variables. attempt #2 to make a basic add,sub.,multi.,divide calculator :)
    
    #include "stdafx.h"
    
    #include <iostream>
    #include <string>
    
    using namespace std;
    int main ()
    {
    	double a;
    	double b;
    	double result;
    
    	cout << "Please enter #1" << endl;
    	cin >> a;  //cIN tells the program to store any variable/integer for future use and set it as "a"
    	;
    
    	cout << "Please enter #2" << endl;
    	cin >> b;  //cIN tells the program to store any variable/integer for future use and set it as "b"
    	;
    
    	cout << "#1 plus #2 is: ";
    	result=a+b;  //tells the program to add a to b
    	cout << result << endl;
    	cout << " " << endl;
    
    
    	cout << "#1 minus #2 is: ";
    	result=a-b;  //tells the program to subtract b from a
    	cout << result << endl;
    	cout << " " << endl;
    
    
    	cout << "#1 times #2 is: ";
    	result=a*b;  //tells the program to multiply a by b
    	cout << result << endl;
    	cout << " " << endl;
    
    	cout << "#1 divided by #2 is: ";
    	 result=a/b;  //tells the program to divide a by b
    	cout << result << endl;
    	cout << " " << endl;
    	
    	cout << "This is kAblE's first calculator in cpp" << endl;
    	cout << "Thanks for using it!" << endl;
    
    	system ("pause");
    
    
    	return 0;
    }
    Thanks to Generist for helping me with my errors and the fact that I forgot to include cin

    Quote Originally Posted by TOXIN
    Shit, now I have to enter this chapacha shit.
    my tumblr
    How To: Not Get Banned Botting

    "Had a dream I was king. I woke up, still king."
    .................................................-Eminem

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    nice to see that you started in the right way.. (with the basics actually) keep with it ^^
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. The Following User Says Thank You to 'Bruno For This Useful Post:

    KABLE (02-21-2010)

  4. #3
    KABLE's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    California
    Posts
    2,863
    Reputation
    192
    Thanks
    282
    My Mood
    Pensive
    Quote Originally Posted by Brinuz View Post
    nice to see that you started in the right way.. (with the basics actually) keep with it ^^
    Thanks :DDD

    Quote Originally Posted by TOXIN
    Shit, now I have to enter this chapacha shit.
    my tumblr
    How To: Not Get Banned Botting

    "Had a dream I was king. I woke up, still king."
    .................................................-Eminem

  5. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Brinuz View Post
    nice to see that you started in the right way.. (with the basics actually) keep with it ^^
    Agreed. All this simple stuff becomes very important later on, so its best to understand it now so you don't have to worry about it when everything else becomes complicated.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #5
    crushed's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    My name is Jay. k?
    Posts
    415
    Reputation
    10
    Thanks
    113
    My Mood
    Sneaky
    Oh snap, he's already learned how to use operators. At this rate, he'll pass Cap'n Why in....a few months. Me in 2-3 days.

    Nice job.

  7. #6
    falzarex's Avatar
    Join Date
    Apr 2008
    Gender
    male
    Location
    here
    Posts
    417
    Reputation
    14
    Thanks
    145
    Yay now try more advanced operations like value storing and trigonometry and logarithmic functions
    JK lol don't brainphuck urself
    Quote Originally Posted by falzarex aka myself
    GTFO FUCKER U DONT BELONG IN THE INTERNETZ WORLD COZ ITS MINE


    This is an epic fail resume
    Hello VBfags.
    A 'member' of the almighty C++ section will soon join you, he is 13 year old, has the IQ and typing skills of a VBfag, so I thought he would fit in here nicely.

    A few reasons why he should be in this section instead of the C++ section:
    1) He has the IQ of a VBfag.
    2) He has no sense of grammer/spelling at all.
    3) He thinks he is pro(like most of the people in here)
    4) He thinks copy pasting is fun(exactly what you guys do)
    5) He loves it up the ass(he will keep you VBfags nice and warm)

  8. #7
    litebrand's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    It's a good start, next you can go onto switches, or goto's.

    Only thing I didn't like was your code format, the randomly placed results were odd.

    And the semi-colons, and the

    Code:
    cout << "  " << endl;
    could just be end lines or escape sequences.

  9. #8
    KABLE's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    California
    Posts
    2,863
    Reputation
    192
    Thanks
    282
    My Mood
    Pensive
    Quote Originally Posted by litebrand View Post
    It's a good start, next you can go onto switches, or goto's.

    Only thing I didn't like was your code format, the randomly placed results were odd.

    And the semi-colons, and the

    Code:
    cout << "  " << endl;
    could just be end lines or escape sequences.
    I didn't learn about the \n command when I made that so I thought a space wouldn't be to bad of a replacement

    Quote Originally Posted by TOXIN
    Shit, now I have to enter this chapacha shit.
    my tumblr
    How To: Not Get Banned Botting

    "Had a dream I was king. I woke up, still king."
    .................................................-Eminem

  10. #9
    Pixipixel_'s Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    VCExpress.exe || France :D
    Posts
    2,087
    Reputation
    27
    Thanks
    742
    My Mood
    Cool
    Quote Originally Posted by kAblE View Post
    I didn't learn about the \n command when I made that so I thought a space wouldn't be to bad of a replacement
    You don't need the \n command
    You can use

    Code:
    cout << result << endl << endl;
    Instead of

    Code:
    cout << result << endl;
    cout << " " << endl;

  11. The Following 2 Users Say Thank You to Pixipixel_ For This Useful Post:

    KABLE (02-22-2010),litebrand (02-22-2010)

  12. #10
    KABLE's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    California
    Posts
    2,863
    Reputation
    192
    Thanks
    282
    My Mood
    Pensive
    Quote Originally Posted by Pixipixel_ View Post


    You don't need the \n command
    You can use

    Code:
    cout << result << endl << endl;
    Instead of

    Code:
    cout << result << endl;
    cout << " " << endl;
    I'ma still learnin'

    Quote Originally Posted by TOXIN
    Shit, now I have to enter this chapacha shit.
    my tumblr
    How To: Not Get Banned Botting

    "Had a dream I was king. I woke up, still king."
    .................................................-Eminem

  13. #11
    litebrand's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    12
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Pixipixel_ View Post


    You don't need the \n command
    You can use

    Code:
    cout << result << endl << endl;
    Instead of

    Code:
    cout << result << endl;
    cout << " " << endl;
    Pretty good suggestions actually :P

  14. #12
    axel fox's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    60
    Reputation
    10
    Thanks
    1
    My Mood
    Amused
    nice job better then Wat i could do

Similar Threads

  1. [help]basic calc.exe hack
    By kibbles18 in forum C++/C Programming
    Replies: 5
    Last Post: 11-14-2010, 03:58 AM
  2. [Release] My very first Visual basics 2008 coded hack!!
    By Ragehax in forum Combat Arms Hacks & Cheats
    Replies: 60
    Last Post: 09-20-2009, 04:33 AM
  3. My First, First Sig really basic
    By kublkun in forum Showroom
    Replies: 10
    Last Post: 04-04-2009, 02:16 AM
  4. Replies: 28
    Last Post: 03-02-2009, 07:44 AM
  5. First Animated *Basically first Sig too*
    By xth3xon3x in forum Showroom
    Replies: 8
    Last Post: 01-29-2009, 04:14 PM