View Single Post
  #2   Spotlight this post!  
Unread 30-12-2009, 23:59
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Kind of off topic c programming question.

I'm not going to give you code as this is for a school assignment however why not trying looping through the numbers and comparing against the upper and lower bound.

Assign the high value and low value variables to a null value
Loop through each input
Check if the high value is null, if so assign the input to the high value
Check if the low value is null, if so assign the input to the low value
If the lower/upper bounds are not null...
set the high value to the input if the input is greater than the current high value
set the low value to the input if the input is lower than the current low value

Take some time to think over the problem - flowcharts are always helpful.

You also have a few errors in your program...slow down, look at your code. Debugging is an art.

I'll give you a few tips:
Watch for typos - I see an invalid comment
Watch your assignments - looking at the main structure of your code where it compares the numbers, I see an incorrect assignment.

Plus when posting code on the forum please use [ CODE ][ /CODE ] (without spaces). Good luck!