Programming Forums
User Name Password Register
 

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

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 19th, 2007, 1:30 AM   #1
kumar310
Newbie
 
Join Date: Nov 2007
Posts: 5
Rep Power: 0 kumar310 is on a distinguished road
help please calculator

Hello Everyone,

I need some help on some HW. I normally don't ask for help about hw but this assignment pretty much determines my grade. Im not asking for you guys to do it for me but I just need a little direction please. My teacher wants me to do the following:

Design and build a parsing calculator. My program must

accept a string of the form 12 * 3 / (123 + 4) ,
do the specified calculation, and
display the result.

The program should continue to ask for input until the user decides to quit.

In addition, this program must use a stack to implement the calculation. You’ll have to

accept the input as a character string,
break it up into its component parts, and
convert it to numbers and operators, and
do the calculation.Notes:

1. Instead of the usual precedence, evaluate expressions from left
to right, but make sure that operations done inside parentheses
are done first. For example, the expression 22 * 3 + ( 2 * 3) ,
should be evaluated:
22 * 3 + ( 6) 66 + 6 72
2. Look up and use the following standard library functions to help with your design:

char* strtok(char*, char*)
double atof(char*)

Please I need some direction !

Kumar
kumar310 is offline   Reply With Quote
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Calculator MiKuS JavaScript and Client-Side Browser Scripting 3 Sep 23rd, 2007 7:46 PM
calculator TecBrain Java 2 Dec 28th, 2005 2:21 PM
Calculator Multiple Operations? jl13 C# 5 Oct 12th, 2005 5:32 PM
Javascript calculator narroweyes JavaScript and Client-Side Browser Scripting 7 Jul 30th, 2005 1:46 PM
simple calculator Jessehk Show Off Your Open Source Projects 4 May 25th, 2005 5:39 PM




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

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