GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Oct-2004, 23:21
andrew410 andrew410 is offline
New Member
 
Join Date: Oct 2004
Posts: 1
andrew410 is on a distinguished road

Need help on a project for C programming


Hi everyone!
I need some help on a project I have. The project details are on this page: www.enee.umd.edu. A summary of what I have to do is that I have to make a program that uses parentheses to show the order of operations.

I can use arrays and basic functions without pointers. Also, I can use switch statements, if and else statements, and loops. I can't use anything else cuz I haven't learned it yet and also I am not allowed to use anything that I have not learned yet.

So far I have:
- A function that tells the precedence of the expression (returns 2 for mult., div., modular, returns 1 for +, -, and returns 0 for anything else).
- A function that returns the length of the expression.
- A main function that searches for negative values and puts parentheses around them.
- An array of characters for the expression and an array of integers for the precedence (both arrays are updated as parentheses are added to the arrays).

This is where I am stuck. I am supposed to ignore anything between parentheses by considering them as a single operand. I made it so that anything between the parentheses has a precedence of 0, but can't figure out a way to put in the parentheses properly.

Any help would be great! Thx!
  #2  
Old 30-Oct-2004, 07:01
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Hi andrew and welcome to GIDForums™.

Most people around here don't have a problem looking at code and finding problems, but most of the times we just don't write solutions to someones questions.

You said you have some code written, you should probably post that and try to be specific about where you are struggling. Also, if you post code, please do it properly between code tags ([c] & [/c])

Thanks!
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
GUI programming crystalattice C++ Forum 5 14-Sep-2004 12:17
Beginning C Programming ToyMachine22122 C Programming Language 7 30-May-2004 10:07
Help with project. anignna C Programming Language 12 27-Apr-2004 07:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.