![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2006
Location: Ireland
Posts: 2
Rep Power: 0
![]() |
Calculator
Hello everyone ive just started learning c++ recently (about 2 weeks ago) and i was wondering if there is any tutorials on how to make a calculator? or someone could point me in the right direction to making one? thanks
-Daniel |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You are new. Please read the forum's rules/FAQ and a "How to Post..." thread. Both encourage searching for answers before posting. Google turns up a shit-load of links such as you seek.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 218
Rep Power: 4
![]() |
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
For something like a calculator, I would recommend thinking about it yourself first. A lot can be learnt from your first attempt at designing, developing and debugging a relatively complicated program. You don't need to provide all the functions of a normal calculator to start with - try something easy first:
Enter the first number: 5 Enter the operator: * Enter the second number: 3 5 * 3 = 15 |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
Yea Ooble's way is a great way to do it,
When i first started C++ the first thing i did was to get the basics of how to input and output, once i had done that i set my self little challenges like making a calculator. It helps you alot as like Ooble said you have to debug etc. Once you have your basic calculator you can build on it and make it better |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
As a matter of fact, you can learn a lot more by modifying it later to use a stack, two stacks, polish notation, any number of things.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
|
Yea definatly and notation will help you alot aswell so when you come back to look at it you will know what code does what and you won't get confused when you look at the big block of code.
i can't talk realy im a bad anotator lol |
|
|
|
|
|
#8 |
|
Programming Guru
![]() ![]() ![]() |
Had to write a complex number class in college, i beat my brain in for a while figuring it out. Definitely start with something simple... then introduce order of operations, etc...
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Mar 2006
Location: Ireland
Posts: 2
Rep Power: 0
![]() |
ok thank you everyone for your replys , help and links ill get to work
![]() -Daniel |
|
|
|
|
|
#10 | |
|
Professional Programmer
|
I agree. One way you could attempt to create a calculator without a tutorial is by creating a very simple app to calculate addition/multiplication/division/subtraction (separate programs if you wish). Then try creating a program that asks for user input for an integer only. With that, you should be able to mend all the necessities into one program. Don't forget to ask the user if they want to do another calculation after the previous, if not, exit.
![]()
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|