Article View: alt.flame.pascal
Article #37Re: Check this OUT!!!!!! Look over here!!!!
From: Mike Copeland
Date: Fri, 22 May 1998 00:00
Date: Fri, 22 May 1998 00:00
96 lines
4285 bytes
4285 bytes
> Hi I am lost completly please help me figure out this prolbem.I can't seem
> to find a way to add words into an array. This is my assignment down below.
And I can see that what you've posted is _only_ the skeleton template
which has been given to you by your instructor - that you have done
absolutely NOTHING in this assignment so far. Why, then, should anyone
here give you the code/logic (the stuff you're supposed to figure out and
do), when (1) we can't benefit from doing your school work and (2) you
wouldn't learn anything from merely turning in someone else's code?
I'm sure that if you had been attending class, staying awake during
the lectures, and doing your previous homework assignments, you'd have
_some_ idea of how to do these little tasks - your teacher can't have
just thrust this assignment at you without ANY preparation, could he/she?
No, it's obviously a matter where you haven't done any of your part and
that you (suddenly) realize you're completely outclassed (so to speak) by
what's going on here. Well, as far as most of us are concerned, you'll
have to show some effort before we'll help - and you haven't yet done
so...
BTW, why don't you and your buddy Parker hash this one out...you're
both doing this same exact assignment...
> CONST
> table = 50;
> max_wordlength = 25;
> lines_per_page = 20;
>
> TYPE
> Word_string = string[max_wordlength];
> Word_array = array [ 1..tablesize] 0f Integer;
> Count_array = array [1..tablesize] of Integer;
>
> VAR
> Word : Word_array;
> Counts : Count_array;
> Infile, Outfile: text;
>
> Function Palindromic (Word : Word_string): Boolean;
> {returns Ture if a word id a palindrome
> ie if the word read the same forwards and backwards}
> Begin
> {code}
> End;
>
> Procedure Add_Word(new_word: word_string;
> Var Words: word_array;
> Var counts : count_array);
>
> {add a new word to the array of words, incrementing the
> corresponding entry in the array of counts or increment the count of an
> existing word}
>
> Begin
> {code}
> End;
>
> Procedure Read_file (VAR Infile : text;
> VAR Words: word_array;
> VAR Counts: count_array);
> {read words from the input file, adding them to the word and count arrays}
> VAR char_buffer : char;
> current_word : word_string;
>
> Begin
> Assign (infile,'name1');
> reset(infile);
> current-word :='';
> While not eof (infile) do
>
> Begin
> Read(infile,char_buffer);
> Case char_buffer of
>
> 'A'..'Z','a'..'z' : current_word := current_word + char_buffer;
>
> Else
> If current_word_word <> '' then {word is non � blank}
> Add_word (current_word, Words,Counts);
> Current_word:= '';
> End;
> End; {case}
> End;
> If current_word <>'' then
> Add_word(current_word, words,counts);
> End;
>
> Begin {main}
>
> {code}
> End. {main program}
>
> I really need help in procedure add_word (current_word, words, counts);
> I can't figure it out. please email me at bal01@hotmail.com
Naw, we don't e-mail answers here - we want everyone to see!
<sigh...>
Technical Details
Message-ID:
<MPG.fcf472fd8e94fe98994c@news.primenet.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<895592972.438063@nn1> <01bd857b$cb359540$160067d1@baljit>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 108ebd,546998be133e9d46 X-Google-Attributes: gid108ebd,public X-Google-Thread: 10cc59,546998be133e9d46 X-Google-Attributes: gid10cc59,public X-Google-Thread: 10261c,546998be133e9d46 X-Google-Attributes: gid10261c,public X-Google-Thread: 111659,546998be133e9d46 X-Google-Attributes: gid111659,public X-Google-Thread: 10eb32,546998be133e9d46 X-Google-Attributes: gid10eb32,public From: mrcope@primenet.com (Mike Copeland) Subject: Re: Check this OUT!!!!!! Look over here!!!! Date: 1998/05/22 Message-ID: <MPG.fcf472fd8e94fe98994c@news.primenet.com> X-Deja-AN: 355574096 References: <895592972.438063@nn1> <01bd857b$cb359540$160067d1@baljit> Organization: Copeland Computer Services X-Posted-By: @206.165.20.7 (mrcope) Newsgroups: alt.flame.pascal,borland.public.turbopascal,comp.lang.pascal,comp.lang.pascal.borland,comp.lang.pascal.misc