I'm doing a program for QBasic class and part of the assignment (for extra credit) is to find the highest bid in a table and put an "*" after it.
Can someone point me in the right direction? I tried sorting them so the highest bid was the last in the column, but how can I get the "*" to print after it. And is there a way to find the highest bid without sorting them?
Any help would be greatly appreciated.
Search for highest bid
Moderators:Administrator, Global Moderator
-
- Newbie
- Posts:1
- Joined:Wed Nov 17, 2004 3:46 pm
- Contact:
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
Yeah, you don't really need to sort them just to print an asterisk after the highest one. You could do something like this...
You'll have to modify the variables to fit your program though.
Code: Select all
HiBid%=-32000
For S%=1 to TotalBids%
If Bid%(S%)>HiBid% then
HiBid%=Bid%(S%)
Marker%=S%
End If
Next
For S%=1 to TotalBids%
Text1$=Str$(Bid%(S%))
If S%=Marker% then
Text2$="*"
Else
Text2$=""
End If
Locate S%,1
Print Text1$ + Text2$
Next
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!