Go to Post only here would you find someone calling a motor cute.... - Denman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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!
 


Thread Tools
Display Modes 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
Off Topic Brett Elflord Chit-Chat 1 30-11-2007 18:05
OFF TOPIC: av switch matt111 Electrical 2 21-03-2004 15:34
Threads getting off topic Mike Soukup CD Forum Support 29 20-08-2001 04:08
chat/off-topic Brandon Martus General Forum 6 06-08-2001 10:10
off topic thread mike o'leary Chit-Chat 4 31-07-2001 22:55


All times are GMT -5. The time now is 07:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi