944,077 Members | Top Members by Rank

Ad:
Oct 13th, 2005
0

Liberty Basic

Expand Post »
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
Print "Congratulations "; Name$; " Has attained "; Grade; " In "; Subject$

if Grade > Result$ then
   Grade = Result$
   print Grade
end if
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:

Print "Congratulations "; Name$; " Has attained "; Grade; " In "; Subject$

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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Stevon is offline Offline
5 posts
since Oct 2005
Oct 13th, 2005
0

Re: Liberty Basic

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...

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,
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
UberAAZ is offline Offline
73 posts
since Oct 2005
Oct 13th, 2005
0

Re: Liberty Basic

thats what im kind of stuck on (to see who highest and display the subject and their mark) lol thanks for the code :cheesy:
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Stevon is offline Offline
5 posts
since Oct 2005
Oct 13th, 2005
0

Re: Liberty Basic

Hmmm, I'lll give that a thought over the next day or so and come back to you with some c0de... perhaps.
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
UberAAZ is offline Offline
73 posts
since Oct 2005
Oct 13th, 2005
0

Re: Liberty Basic

Ok thanks again mate
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Stevon is offline Offline
5 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: Free BASIC Tool
Next Thread in Legacy and Other Languages Forum Timeline: Liberty Basic Print Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC