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

Username:   Password: 
 RegisterRegister   
 What do i do now?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DBZ




PostPosted: Sat Jan 10, 2004 6:03 pm   Post subject: What do i do now?

I need the program to read this word document, i have attatched int his post, in order to execute the program! but i don't know what to do next!
Here is the program i have don't so far:

var cityto,cityfrom:string
var fare:int
put"Please enter the city you want to fly to:"
get cityto
put"Please enter the city you are flying from:"
get cityfrom
open: "Fare"
put fare

And i am also attatching the word document!



Fare.doc
 Description:

Download
 Filename:  Fare.doc
 Filesize:  19 KB
 Downloaded:  254 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
santabruzer




PostPosted: Sat Jan 10, 2004 6:46 pm   Post subject: (No subject)

why don't you use a simple txt file though?
DBZ




PostPosted: Sat Jan 10, 2004 8:17 pm   Post subject: (No subject)

What do u mean? What's a txt. file?
Andy




PostPosted: Sat Jan 10, 2004 8:20 pm   Post subject: (No subject)

well at least we know he's the first part of his title
Dan




PostPosted: Sat Jan 10, 2004 9:06 pm   Post subject: (No subject)

a .txt is ushley an uncoded ACII document. if you are on windows, notebook deals with this text format and it can be read on almost any computer.

an uncoded text file whould be best to uses with turing b/c you dont have to deal with all the codes that word puts in behind the sences.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Thuged_Out_G




PostPosted: Sun Jan 11, 2004 12:06 am   Post subject: (No subject)

here is how you read from a text file
code:

var stream:int %stream number to assign to file
var word:string %variable to hold each word from the file
var lines:array 1..number of words in file %an array to store each word in the file
open:stream,filename.txt",get %opens the file
assert stream > 0 %asserts it so that if it isnt bigger then 0, then it was not opened

for i:1..number of words in the file
get:stream,skip %skips all white space in the file
get:stream,word %gets the [i]ith[/i] word in the file
lines(i):=word %stores the word in the array
exit when eof(stream) %exit at the end of the file
end for
DBZ




PostPosted: Sun Jan 11, 2004 6:37 pm   Post subject: (No subject)

Alright then, i'll use the notebook for this program! Thanx for ur suggestions and help!
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  [ 7 Posts ]
Jump to:   


Style:  
Search: