Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 8th, 2006, 10:31 AM   #1
TriColor
Newbie
 
Join Date: Mar 2006
Location: Ireland
Posts: 2
Rep Power: 0 TriColor is on a distinguished road
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
TriColor is offline   Reply With Quote
Old Mar 8th, 2006, 11:34 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Mar 8th, 2006, 11:37 AM   #3
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
A calculator tutorial is here. You should really read dome other tutorials first. I learned from this site that was very useful when I got started on C++
zorin is offline   Reply With Quote
Old Mar 8th, 2006, 12:43 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Mar 8th, 2006, 1:29 PM   #5
HaCkeR
Hobbyist Programmer
 
HaCkeR's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 131
Rep Power: 0 HaCkeR is an unknown quantity at this point
Send a message via AIM to HaCkeR Send a message via MSN to HaCkeR
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
HaCkeR is offline   Reply With Quote
Old Mar 8th, 2006, 2:04 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Mar 8th, 2006, 2:06 PM   #7
HaCkeR
Hobbyist Programmer
 
HaCkeR's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 131
Rep Power: 0 HaCkeR is an unknown quantity at this point
Send a message via AIM to HaCkeR Send a message via MSN to HaCkeR
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
HaCkeR is offline   Reply With Quote
Old Mar 8th, 2006, 2:47 PM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Mar 8th, 2006, 4:16 PM   #9
TriColor
Newbie
 
Join Date: Mar 2006
Location: Ireland
Posts: 2
Rep Power: 0 TriColor is on a distinguished road
ok thank you everyone for your replys , help and links ill get to work

-Daniel
TriColor is offline   Reply With Quote
Old Mar 8th, 2006, 4:30 PM   #10
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
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:
Originally Posted by Mohamed Jihad
Durka durka!
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!
jayme is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:54 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC