Skip to main content
GameDev.net gamedev.net
🔒 Locked

Calculator(Project1) - In progress!

Started by Roberts91 Jan 18, 2008 at 3:16 PM 11 replies 1.7k views
Original Post
Roberts91
Roberts91
Hey again everyone. Everyday my skills in C++ grow and in the end I want to be able to make simple games and someday go into the game industry. This is my offical first project. That I have made completly from my own code. It's a VERY simple program but I want to make it a little more advanced with your help. Please if you have the time download this file and check out my simple project which is you guessed it! Simple calculator. Please give any suggestions on what should be fixed or added to it. Thanks! Features: Adds - Whole and Decimel numbers Subtracts - Whole and Decimel numbers Multiplys - Whole and Decimel numbers Divides - - Whole and Decimel numbers Download: Program: Calculator v1.2.0 Parts: 01 Size: 79KB http://rapidshare.com/files/84882239/Calculator_v1.2.0.rar.html Instructions: 1.Download the link from the address above. 2.Open it with winrar 3.Unrar all files to a directory on your hard drive where you can find it! 4.Load the .exe file and have fun! Fixed: - Window closing after executing two numbers Update: Reworked the code completly. Changed title of window and added new text font. Some messages have been changed. [Edited by - Roberts91 on January 18, 2008 5:22:30 PM]
dpadam450
dpadam450
1. This belongs in "Your Announcements"

2. No offense but its a calculator, maybe 30 lines of code....

if(divide_button)
{
numer /= dividend;
}

c++ kinda does everything for you.....
NBA2K, Madden, Maneater, Killing Floor, Sims 
Roberts91
Roberts91
I know don't get me wrong on throwing an attitude I just don't have another way of putting it. This wasn't meant for show and tell. This is my FIRST program in well programming. I'm looking on suggestions to improve my code, to improve the simple calculator into an advanced one. And maybe down the road into a GUI based calculator. This is not in any way suppose to beat Microsoft's calculator it is for learning purposes only.
smart_idiot
smart_idiot
Any calculator that can't calculate the square root of pi raised to e with ten thousand digits of precision just isn't worth using, in my opinion.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Roberts91
Roberts91
Quote:
Original post by smart_idiot
Any calculator that can't calculate the square root of pi raised to e with ten thousand digits of precision just isn't worth using, in my opinion.


To be honest. I wonder if that's possible. See sarcasam can unlock the potential of new and creative thinking. Maybe not square root of pi raised to e. But maybe I could add square root, and maybe I could add some good precision into my programming maybe not 10,000 digits of precision, but a large amount. That is something to think about. Thanks!

smart_idiot
smart_idiot
10,000 isn't that much, just a screen's worth of text, about.

Also, if you want a math library that can handle really big numbers, my vote goes to GMP.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Roberts91
Roberts91
version 1.2.0 is now up! haha, reworked the code completly as people suggested instead of using if statements it's using switch statements, messages have changed to be more understandable, change title of program and font color. Also can now deal with larger and more precise numbers.
_Sigma
_Sigma
wtf, RapidShare is a 404?
smart_idiot
smart_idiot
Don't be silly, how could a server reply with error code 404 if you can't connect to it?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
_Sigma
_Sigma
Sorry, I used 404 incorrectly, as a generic "can't find anything". You're right .. :(

wtf, RapidShare is a 404 down?

Quote:
As of 19 January 2008 16:00 GMT, Rapidshare's servers appear to be offline. There are rumors that Rapidshare has been shut down by the authorities after a court order, however, court records do not reveal any issued Rapidshare court order as of yet. Rapidshare technician Steven Gircham has commented on this issue - "There are rumors concerning attacks made on the Rapidshare.com servers. There are also rumors that Rapidshare has been shut down by a court order. These rumors are false. We would like to apologize to our users and inform them that no data has been lost. There have been some hardware issues as a result of high bandwidth and server overload. We are doing our very best to resolve the hardware issues, and users should expect uptime by midnight tonight (GMT)"

Interesting...However its back up now.
coding penguin
coding penguin
Quote:
Original post by _Sigma

wtf, RapidShare is a 404 down?


seems to be up and running now
_Sigma
_Sigma
Quote:
Original post by Roberts91 Also can now deal with larger and more precise numbers.


You should perhaps look for overflow & numbers that can't be properly stored...

Quote:
Please enter the first number that you would like to use.
999999999999999999999999999999999999999999999999999999999999999
Please enter the operation that you would like to complete. (+,-,* or /)
*
Please enter the second number you would like to use.
999999999999999999999999999999999999999999999999999999999999999
The answer is: 1e+063 * 1e+063 = 1e+126
Would you like to start again? (y or n)

Not *quite* right....

Good job with the app. Glad to see you're proud of what you have done!
GroZZleR
GroZZleR
How are we supposed to critique your source code if you don't provide it?

I don't see a reason to switch to if statements as you've alluded to doing. You have four clearly defined operations and that's the perfect time for a switch statement.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.