• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 6 of 6
    1. #1
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      WiTH's Avatar
      Join Date
      May 2012
      Posts
      62
      Thanks (-->)
      1
      Thanks (<--)
      10

      how to make a simple c++ calculator

      John Kittz
      hello guys, this is my first post here and my first program...
      i like c++, but its hard for first language, so i stopped for some time and im currently learning c#

      Code:
      #include "stdafx.h" // only needed for microsoft compiler
      #include &lt;iostream&gt;
      
      using namespace std;
      
      
      int main()
      {
      	long double w,i,t; // declaring the first and second operator, and result
      	char h; // declaring the operator choice and at the same time, the choice of using the calculator again
      
      	cout &lt;&lt; "Simple Calculator\n" &lt;&lt; "Write the first number:" &lt;&lt; endl; // simple text output
      	cin &gt;&gt; w; // waiting for input
      	cout &lt;&lt; "Now write the second number:\n";
      	cin &gt;&gt; i;
      	cout &lt;&lt; "And the Operator:\n";
      	cin &gt;&gt; h;
      
      	if (h == '+') // comparing the opperator
      		t = w + i;
      	if (h == '-')
      		t = w - i;
      	if (h == '/')
      		t = w / i;
      	if (h == '*')
      		t = w * i;
      
      	cout &lt;&lt; "\nThe result is: " &lt;&lt; t &lt;&lt; endl &lt;&lt; "If you want to use the calculator again press \"y\"...\n"; // show the result
      	cin &gt;&gt; h;
      
      	if (h == 'y')
      	{
      		system ("cls"); // clear console screen
      		return main(); // restart calculator
      	}
      	else
      		return 0; // quit calculator
      }
      this is very simple, but can help some beginners and i would like some feedback


    2. Thanks Fegga, sdfsdfsdfsdf thanked for this post
    3. #2
      Hacker
      Learning to hack games!
       
      Pawning
       
      Fleep's Avatar
      Join Date
      May 2012
      Posts
      626
      Thanks (-->)
      208
      Thanks (<--)
      727

      Re: how to make a simple c++ calculator

      Nice and simple, but good program for a beginner

      Fleep

    4. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Flyjunkie's Avatar
      Join Date
      May 2012
      Posts
      45
      Thanks (-->)
      0
      Thanks (<--)
      0

      Re: how to make a simple c++ calculator

      Nice and easy way to get people into a little bit of coding there WiTH def liking it!

    5. #4
      Newbie
      0x90
       
      Awesome
       
      AxDSan's Avatar
      Join Date
      May 2012
      Location
      Ring0
      Posts
      49
      Thanks (-->)
      6
      Thanks (<--)
      1

      Re: how to make a simple c++ calculator

      Another neat idea, is to make a switch:case menu with options you want Addition, Substraction etc, etc.
      how to make a simple c++ calculator
      Just Kidding! Don't Click OK! GuidedHacking.COM Rocks!~

    6. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Flyjunkie's Avatar
      Join Date
      May 2012
      Posts
      45
      Thanks (-->)
      0
      Thanks (<--)
      0

      Re: how to make a simple c++ calculator

      Another neat idea, is to make a switch:case menu with options you want Addition, Substraction etc, etc.
      cases ftw! May also be an idea to get them in the habit of checking if the input is valid or not using a FOR and the 'isdigit' function...in this numeric case.

    7. #6
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      WiTH's Avatar
      Join Date
      May 2012
      Posts
      62
      Thanks (-->)
      1
      Thanks (<--)
      10

      Re: how to make a simple c++ calculator

      Cheats'n'Trainers
      thanks fleep and flyjunkie
      the switch case sounds a good idea, but im more used to if statements :P

    Similar Game Hacker Threads

    1. [Help] Simple Wallhacking
      By monira02 in forum Hacking Help
      Replies: 6
      Last Post: 04-03-2016, 12:52 AM
    2. [Source Code] C/C++ 2 num. calculator
      By tvojama in forum Misc Coding
      Replies: 5
      Last Post: 12-22-2015, 03:12 PM
    3. Simple Reverse-Me
      By Solaire in forum Challenges
      Replies: 27
      Last Post: 02-03-2015, 06:28 AM
    4. Need some help with a simple trainer.
      By anton1453 in forum C#
      Replies: 2
      Last Post: 04-21-2014, 02:53 PM