Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,916 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,101 people online right now. Registration is fast and FREE... Join Now!




How to make a calculator program using functions?

 
Reply to this topicStart new topic

How to make a calculator program using functions?

baban
5 Jan, 2008 - 10:37 PM
Post #1

New D.I.C Head
*

Joined: 5 Jan, 2008
Posts: 3

How can I make a calculator using functions??
User is offlineProfile CardPM
+Quote Post

Louisda16th
RE: How To Make A Calculator Program Using Functions?
5 Jan, 2008 - 11:00 PM
Post #2

 101010101
Group Icon

Joined: 3 Aug, 2006
Posts: 1,812



Thanked: 1 times
Dream Kudos: 755
My Contributions
You'll have to show your code if you want someone to help you.
In case you don't know how to code the program, this should help get you started:
Write four functions: One for each arithmetic operation. The functions should each accept to arguments - the operands and return the result.
Ask the user to input two numbers and the operator in your main function.
Check what operator the user enters and call the appropriate function. You can use an if-else construct or a switch case construct (the latter would be better).
Output the answer in the main function itself.

Hope this helps smile.gif.
User is offlineProfile CardPM
+Quote Post

baban
RE: How To Make A Calculator Program Using Functions?
6 Jan, 2008 - 03:39 AM
Post #3

New D.I.C Head
*

Joined: 5 Jan, 2008
Posts: 3

QUOTE(baban @ 5 Jan, 2008 - 11:37 PM) *

How can I make a calculator using functions??



Tnx... :-)
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 02:25PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month