Liberty Basic

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2005
Posts: 5
Reputation: Stevon is an unknown quantity at this point 
Solved Threads: 0
Stevon Stevon is offline Offline
Newbie Poster

Liberty Basic

 
0
  #1
Oct 13th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 73
Reputation: UberAAZ is an unknown quantity at this point 
Solved Threads: 1
UberAAZ's Avatar
UberAAZ UberAAZ is offline Offline
Junior Poster in Training

Re: Liberty Basic

 
0
  #2
Oct 13th, 2005
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,
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 5
Reputation: Stevon is an unknown quantity at this point 
Solved Threads: 0
Stevon Stevon is offline Offline
Newbie Poster

Re: Liberty Basic

 
0
  #3
Oct 13th, 2005
thats what im kind of stuck on (to see who highest and display the subject and their mark) lol thanks for the code :cheesy:
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 73
Reputation: UberAAZ is an unknown quantity at this point 
Solved Threads: 1
UberAAZ's Avatar
UberAAZ UberAAZ is offline Offline
Junior Poster in Training

Re: Liberty Basic

 
0
  #4
Oct 13th, 2005
Hmmm, I'lll give that a thought over the next day or so and come back to you with some c0de... perhaps.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 5
Reputation: Stevon is an unknown quantity at this point 
Solved Threads: 0
Stevon Stevon is offline Offline
Newbie Poster

Re: Liberty Basic

 
0
  #5
Oct 13th, 2005
Ok thanks again mate
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Legacy and Other Languages Forum


Views: 3010 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Legacy and Other Languages
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC