Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Bibliography Maker
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
andrew.




PostPosted: Mon May 05, 2008 4:30 pm   Post subject: Bibliography Maker

I was making this program so I can enter in the information and it makes my bibliography, but for some reason, when it gets to the part where it gets the title from the user, it just skips the last get line. Try it.

Turing:

setscreen ("graphics")
var num_of_entries : int
put "How many books would you like to register in the database?"
get num_of_entries
var title, author, publisher, datepublished, placepublished : array 1 .. num_of_entries of string
for i : 1 .. num_of_entries
    put "What is the title of the book ", i, "?"
    get title (i)
end for
put "Great!"
Input.Pause

for i : 1 .. num_of_entries
    put "Who is the author(s) of ", title (i), "?"
    get author (i)
end for
put "Great!"
Input.Pause

for i : 1 .. num_of_entries
    put "What is the publisher of ", title (i), "?"
    get publisher (i)
end for
put "Great!"
Input.Pause

for i : 1 .. num_of_entries
    put "What is the date published of ", title (i), "?"
    get datepublished (i)
end for
put "Great!"
Input.Pause

for i : 1 .. num_of_entries
    put "What is the place published for ", title (i), "?"
    get placepublished (i)
end for
put "Great!"

var stream : int
open : stream, "Bibliography.txt", put
for i : 1 .. num_of_entries
    put : stream, "Bibliography"
    put : stream, "Author, Title, Place Published, Publisher, Date Published"
    put : stream, ""
    put : stream, author (i), ". ", title (i), ". ", placepublished (i), ": ", publisher (i), ", ", datepublished (i)
    put : stream, ""
end for
close : stream

put "Your file has been saved as 'Bibliography.txt'."


I've tried to play around with it adding different things but nothing changes it.
Sponsor
Sponsor
Sponsor
sponsor
cavetroll




PostPosted: Mon May 05, 2008 5:19 pm   Post subject: RE:Bibliography Maker

I think your problem might be in the way you get your data. Try using
code:

get var :*

for getting the variables. This just allows for a whole line of text to be entered.
andrew.




PostPosted: Mon May 05, 2008 5:24 pm   Post subject: RE:Bibliography Maker

Thank you. Good karma for you!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: