
-----------------------------------
bizkit
Sat Nov 16, 2002 9:40 pm

I NEED HELP! :(
-----------------------------------
Hey Hows it goin?
i have an assignment due that im totally lost on ive made most of the code but about 5 lines can you help me out? this is the assigntment outline:
Each day, the Northcastle Times newspaper receives a file called 'listings' provided by TV Guide in a list form. This file is used to publish the local TV listings in the newpaper. The file has the following format.

Time: 7:00
channel
program title
details
channel
program title
details
Time: 7:30
channel
program title
details
channel
program title
details
channel
program title
details
channel
program title
details

etc.

The file is suitable for producing a listing in column format. Channels with programs more than a half hour long will not appear in the next time slot in the 'listings' file. This information in list form is published daily.
The TV program information is also published in a chart form. This has proved popular with readers of the newspaper.
I've made most of the code but im stuck on this part:
        %1 get line from file
        progtitle := line
        lengthprogtitle = progtitle
        if lengthprogtitle>18 then  
           lengthprogtitle= 18
        %6    progtitle = first 18 characters of progtitle
         end if
        %8 numspaces = number of spaces needed to fill 18 space slot
        %9 spaces = " how many are needed " - hint use repeat function
        %10 chart(row) = chart(row) +  ...
        get :streamnumber, line : * %get program details but don't use
        exit when eof(streamnumber)
1 more thing is i dont know how to display what i got from the file which is:
procedure print_chart(var chart : array 1..12 of string)
    put "CH      7:00               7:30              8:00              8:30"
    % 11 lines needed to print chart
    % 12
    % 13
end print_chart

thanks alot
Kyle

-----------------------------------
TokenHerbz
Mon Oct 24, 2005 11:19 pm


-----------------------------------
No!

-----------------------------------
Tony
Tue Oct 25, 2005 7:53 am


-----------------------------------
well you read from file later on in your code, why are you having difficulties in the beginning?

put "formatting" : 30, "is" : 20, "easy" : 10, "!"
put "it" : 30, "really" : 20, "is" : 10, "."


you also appear to have an exit when, but no loop. Where were you getting those lines of code from?

oh, and you use length() to find out how long the string is.

-----------------------------------
[Gandalf]
Wed Oct 26, 2005 4:38 am


-----------------------------------
No!
And then you ask for help  :roll: .

-----------------------------------
TokenHerbz
Wed Oct 26, 2005 1:23 pm


-----------------------------------
dont hate me but.....


Posted: Sat Nov 16, 2002 10:40 pm    Post subject: I NEED HELP! :(




I dont know why i did it...  :'(

-----------------------------------
[Gandalf]
Wed Oct 26, 2005 2:08 pm


-----------------------------------
wtf?  Oh, so you broke many rules as opposed to one - great!  :evil:

Cervantes says: Indeed.  Calls for some negative bits.  Something of the order of... 15?   :twisted: 
Net gain for TokenHerbz from Cervantes = 0
