Jump to content
  • Advertisement
Sign in to follow this  
theadamSGT

calculater (solved)

This topic is 4858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

could someone give me a tutorial for making a calculater i think i have enough experiance with c++ i just dont know how to make it [Edited by - theadamSGT on July 28, 2005 7:12:27 AM]

Share this post


Link to post
Share on other sites
Advertisement
How advanced do you want it to be?

If you want a calculator which allows you to enter in a large expression, (e.g. "4 * 9/5 + 467.24/(7*(4*6/5))") you'll want to look up "infix notations" and binary trees.

Here's a nice article discussing how to convert to infix and use binary trees to simplify.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
-Spelling error found in thread title
-'Calculater' undefined; candidates are: 'Calculator'

Share this post


Link to post
Share on other sites
i just want to make a simple calculator + - * and / not 4 * 9/5 + 467.24/(7*(4*6/5)) that would be cool thanks for the spelling word

Share this post


Link to post
Share on other sites
Get "The C++ Programming Language" by Stroustrup. In chapter 6, "Expressions and Statements", he develops a simple calculator that parses and computes simple expressions.

Share this post


Link to post
Share on other sites
I call "homework question".

Put it this way - if you had the C++ experience to make a calculator, you could make a calculator.

That being said, go and take a look at some basic tutorials. I think you could get user input using cin, use a simple switch statement to parse your input, calculate the answer and then output with cout.

Another hint: Combine those bold terms with "C++" and try Google. I've even done the first one for you.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!