Go Back   Gaming Gutter > Non-Gaming > Programming > Source Code


Source Code - Have a source code/project files you want to post? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Heather wants to kill a...
Today 06:49 PM
Last post by .BloodyNightmare
Today 07:32 PM
14 Replies, 47 Views
Go to first new post The ctrl v button game!
04-07-2007 02:50 PM
Last post by Arthritis
Today 07:30 PM
765 Replies, 6,540 Views
Go to first new post On a serious note
Today 07:28 PM
by Bex
Last post by Bex
Today 07:29 PM
1 Replies, 2 Views
Go to first new post Froze-owned
11-03-2008 08:32 PM
by Reemer
Last post by checkone
Today 07:27 PM
15 Replies, 314 Views
Go to first new post forgot my birthday i put...
10-30-2008 09:27 AM
by dookie
Last post by checkone
Today 07:25 PM
22 Replies, 463 Views
Reply
 
LinkBack Thread Tools Display Modes

 C++ Console Calculator
Old 08-20-2008, 08:56 PM   #1 (permalink)

Male Connor is offline
 
Connor's Avatar
 
Join Date: Dec 2006
Location: Preston
Age: 15
Posts: 2,726
GPoints: 1,351
iTrader: 0 / 0%
Connor Is Recognizable
Rep Power: 9
C++ Console Calculator

Code:
//Connor's calculator. OMG IT'S SO COMPLICATED!??!?! No.

#include <iostream.h>
#include <windows.h>

void main()
{
//variables
	long Num1;
	long Num2;
	long final;
	char Buffer[9];
	



cout << "Enter your first number: "<< endl;
cin >> Num1;
cout << "Enter your second number: " << endl;
cin >> Num2;
cout << "Say what you want to do (+, -, / or *) " << endl;
cin >> Buffer;

if ( lstrcmp( Buffer, "+" ) == 0 )
{
final = Num1+Num2;
}

if ( lstrcmp( Buffer, "-" ) == 0 )
{
final = Num1-Num2;
}

if ( lstrcmp( Buffer, "*" ) == 0 )
{
final = Num1*Num2;
}

if ( lstrcmp( Buffer, "/" ) == 0 )
{
final = Num1/Num2;
}



cout << "The final answer is: " << final << endl;


}
It's easy stuff but it's the next step up from "Hello World".
I had trouble finding the stuff to learn this, so I thought I'd post it.
__________________
Formerly Connor
  Reply With Quote

 
Old 08-20-2008, 08:58 PM   #2 (permalink)
Resident Psychopath.

Male Fewmitz is online now


 
Fewmitz's Avatar
 
Join Date: Nov 2006
Location: fewmitz@live.com
Posts: 5,378
GPoints: 2,485
iTrader: 1 / 100%
Fewmitz Is a Party CaptainFewmitz Is a Party CaptainFewmitz Is a Party Captain
Rep Power: 17
You didn't even make a GUI!

I know really basic C, if you need help, just FYI.
  Reply With Quote

 
Old 08-20-2008, 09:25 PM   #3 (permalink)

Male Connor is offline
 
Connor's Avatar
 
Join Date: Dec 2006
Location: Preston
Age: 15
Posts: 2,726
GPoints: 1,351
iTrader: 0 / 0%
Connor Is Recognizable
Rep Power: 9
Quote:
Originally Posted by Fewmitz View Post
You didn't even make a GUI!

I know really basic C, if you need help, just FYI.
What?
This is console C++.
If you want to do GUI's you should use C# with functions from DLLs using C++
__________________
Formerly Connor
  Reply With Quote

 
Old 08-21-2008, 05:37 AM   #4 (permalink)

Male |G3| is online now

 
|G3|'s Avatar
 
Join Date: Feb 2007
Posts: 3,781
GPoints: 6,413
iTrader: 9 / 100%
|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo
Rep Power: 21
elseifs = proper way of doing it
or maybe you can use case too.
__________________
proxy sites | proxy | web proxy | glype proxy
GAIA FLP GENERATOR


Thanks Hatz ;3

  Reply With Quote

 
Old 08-21-2008, 05:38 AM   #5 (permalink)
Resident Psychopath.

Male Fewmitz is online now


 
Fewmitz's Avatar
 
Join Date: Nov 2006
Location: fewmitz@live.com
Posts: 5,378
GPoints: 2,485
iTrader: 1 / 100%
Fewmitz Is a Party CaptainFewmitz Is a Party CaptainFewmitz Is a Party Captain
Rep Power: 17
Quote:
Originally Posted by Connor View Post
What?
This is console C++.
If you want to do GUI's you should use C# with functions from DLLs using C++
I know what it is.

I also know the, you know, gooder way of doing it.
  Reply With Quote

 
Old 08-21-2008, 05:51 AM   #6 (permalink)

Male Connor is offline
 
Connor's Avatar
 
Join Date: Dec 2006
Location: Preston
Age: 15
Posts: 2,726
GPoints: 1,351
iTrader: 0 / 0%
Connor Is Recognizable
Rep Power: 9
Quote:
Originally Posted by Fewmitz View Post
I know what it is.

I also know the, you know, gooder way of doing it.
Gooder?
__________________
Formerly Connor
  Reply With Quote

 
Old 08-21-2008, 05:55 AM   #7 (permalink)
hi fucktard

Male terinuptrash is offline
 
terinuptrash's Avatar
 
Join Date: Aug 2008
Location: anywhere hate runs rampant
Posts: 514
GPoints: 1,926
iTrader: 0 / 0%
terinuptrash Is Amongst Royaltyterinuptrash Is Amongst Royalty
Rep Power: 2
Thumbs up

holy fuck connor. you know C++ at 15!!!!!!!!!!!!! i was learning fucking basic languages at 15. i still dont have have C++ down.
__________________

if my fucking link to my menu doesnt work heres the direct link
(copy and paste in address bar)
http://www.freewebs.com/terinuptrash/menue/sig.swf
and ive decided to revise my current top friends on myspace, so you guys are allowed on it now.
i love my .BloodyNightmare <3
o-bby
  Reply With Quote

 
Old 08-21-2008, 05:58 AM   #8 (permalink)

Male |G3| is online now

 
|G3|'s Avatar
 
Join Date: Feb 2007
Posts: 3,781
GPoints: 6,413
iTrader: 9 / 100%
|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo|G3| Is a Subordinate to Kyo
Rep Power: 21
Quote:
Originally Posted by terinuptrash View Post
holy fuck connor. you know C++ at 15!!!!!!!!!!!!! i was learning fucking basic languages at 15. i still dont have have C++ down.
He barely knows it, calm down.
__________________
proxy sites | proxy | web proxy | glype proxy
GAIA FLP GENERATOR


Thanks Hatz ;3


Last edited by |G3|; 08-21-2008 at 06:02 AM.
  Reply With Quote

 
Old 08-21-2008, 06:02 AM   #9 (permalink)

Male Googlrr is online now
 
Googlrr's Avatar
 
Join Date: Oct 2006
Location: New Hampshire?
Posts: 6,830
GPoints: 282
iTrader: 0 / 0%
Googlrr Is a Lord of AwesomenessGooglrr Is a Lord of AwesomenessGooglrr Is a Lord of AwesomenessGooglrr Is a Lord of Awesomeness
Rep Power: 20
Quote:
Originally Posted by terinuptrash View Post
holy fuck connor. you know C++ at 15!!!!!!!!!!!!! i was learning fucking basic languages at 15. i still dont have have C++ down.
He made a calculator.
__________________

<3 Li'



Hatz =D

  Reply With Quote

 
Old 08-21-2008, 06:03 AM   #10 (permalink)
hi fucktard

Male terinuptrash is offline
 
terinuptrash's Avatar
 
Join Date: Aug 2008
Location: anywhere hate runs rampant
Posts: 514
GPoints: 1,926
iTrader: 0 / 0%
terinuptrash Is Amongst Royaltyterinuptrash Is Amongst Royalty
Rep Power: 2
Quote:
Originally Posted by |G3| View Post
He barely knows, calm down.
still. C++ is a huge language and its kinda intimidating. if i was 15 and i saw how huge C++ is, i would back down and not even attempt to learn it.

but this kinda looks like something to have to do with a class project or something. so its not as impressive. and i see your point
__________________

if my fucking link to my menu doesnt work heres the direct link
(copy and paste in address bar)
http://www.freewebs.com/terinuptrash/menue/sig.swf
and ive decided to revise my current top friends on myspace, so you guys are allowed on it now.
i love my .BloodyNightmare <3
o-bby
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 07:36 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.16560197 seconds (100.00% PHP - 0% MySQL) with 19 queries