| | |
Liberty Basic
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2005
Posts: 5
Reputation:
Solved Threads: 0
Hi all, this question is for liberty basic (not sure if its the same or simmiler) but i am desperate for help :cry: it opens a txt file and reads the records the layout of the file is like this :
HEN01023025,Jane Henderson,10/02/1982,Maths,67
HEN01023025,Jane Henderson,10/02/1982,Science,24
i have started a program that needs to do the following "this option should print out the name of the student who has attained the highest mark in a single exam. it should show their name, the subject and the mark attained"
i have been able to get the highest gade but i need help to get the subject and grade in a print statement i.e
i can do the Highest mark but i dont know how to make it so that the Name of the student and the subject that they had the mark in show up
but im stuck i have to print the information like this:
Thanks alot in advance
hope you guys can help
p.s sorry that its LB not VB but i cant find a forum for it
HEN01023025,Jane Henderson,10/02/1982,Maths,67
HEN01023025,Jane Henderson,10/02/1982,Science,24
i have started a program that needs to do the following "this option should print out the name of the student who has attained the highest mark in a single exam. it should show their name, the subject and the mark attained"
i have been able to get the highest gade but i need help to get the subject and grade in a print statement i.e
Print "Congratulations "; Name$; " Has attained "; Grade; " In "; Subject$
if Grade > Result$ then Grade = Result$ print Grade end if
but im stuck i have to print the information like this:
Print "Congratulations "; Name$; " Has attained "; Grade; " In "; Subject$
Thanks alot in advance
hope you guys can helpp.s sorry that its LB not VB but i cant find a forum for it
Well, I just wrote this... I haven't run it and don't know if it will be compatible with Liberty Basic (this uses QBasic syntax):
The text file shouldn't need to be modified so...
should do just fine. For the code of the app you should use something like...
That's only basic (ignore the pun), but if you put it inside a loop, then you should be able to get a working program.
To see who got the highest result, you could probably do an if statement inside a while loop.
Hope that helped,
The text file shouldn't need to be modified so...
HEN01023025,Jane Henderson,10/02/1982,Maths,67 HEN01023025,Jane Henderson,10/02/1982,Science,24
should do just fine. For the code of the app you should use something like...
open "data.txt" for input as 1 input #1, code$,name$,datez$,subject$,score$ close 1 print "Well done! "+name$+" achieved grade "+score$+" in "+subject$+" on "+datez$+"."
That's only basic (ignore the pun), but if you put it inside a loop, then you should be able to get a working program.
To see who got the highest result, you could probably do an if statement inside a while loop.
Hope that helped,
![]() |
Similar Threads
- BASIC Languages File I/O Help (Legacy and Other Languages)
- Liberty Basic (Legacy and Other Languages)
- which language ? (Computer Science)
- Commands for, Liberty Basic (Visual Basic 4 / 5 / 6)
- A solution for QBASIC on WINDOWS XP (Legacy and Other Languages)
- Beyond Qbasic... (Legacy and Other Languages)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Question about DOS Batch Files
- Next Thread: Liberty Basic Print Help
Views: 3010 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Legacy and Other Languages






lol thanks for the code :cheesy: