Board index » delphi » NEW USER NEEDS HELP

NEW USER NEEDS HELP

I need halp writing a program, it has to do the following :-

I need to write a program that monitors the use of a photocopier.

Each member of staff is given a unique 4-digit PIN number and the
machine keeps a count in a local binary disk file of how many
photocopies have been credited to each pin. Periodically this file is
downloaded to a PC where a program is run which creates a text file
containing a report on the current use of the photocopier.

The program must

1) Prompt the user for the name of the binary file.
        The file consists of records, each with the following structure:-

        Intals of person STRING[4]
        PIN              INTEGER
        Number of copies INTEGER

I don't know how many records are in the file, but there should be no
more than 50. If there are an error message should appear and the
program should exit.

2) read in the binary file and create a text file called photocpy.txt
containing the report. The records in the text file must be sorted in
ascending order of number of copies.

3) prints a message to the screen, telling the user how many records
were written to the text file, or if there were more than fifty records,
warning the user that an error has occured.

Here is an example of a report which might be written to the text file.

name            pin             number of copies

HCL             2899            53
DDT             1864            2234
AWOL            4852            8244

I would be very greatful if someone could reply to me by e-mail with any
suggestions or solutions.

 

Re:NEW USER NEEDS HELP


Are you completely unable to do anything with this (homework)
assignment except post it here, hoping some fool will do it for you?
What we see in your post is _only_ the class assignment, but there's no
evidence of any work on it by you.  It's clear you indeed "need help",
but what's the benefit to you if we do your work and you hand in
something which you can't explain or validate as your own?
   This NG doesn't "do homework assignments" for students, and you
should know that the only way to get help here is to post detailed
questions (and code/design snippets) which (1) explain your problem
fully and (2) show your efforts so far - so the help we offer will mean
something to you and won't won't exceed you ability to understand it (a
real possibility, since all manner and levels of students come here).
   This problem is non-trivial, I admit, but where were you during the
semester up 'til now?  Weren't you attending class and doing the other
assignments?  (It appears not, since you seem totally helpless here...)
I'd wager you must have had _some_ opportunity to (1) learn the
background concepts (file i/o, records, output formatting, etc.) that
such a problem needs and (2) discuss your difficulties with your
instructor(s) before this - why come to this NG now?  Such a display of
helplessness on your part does little to encourage sympathy or any
desire to help you...

Quote
> I need halp writing a program, it has to do the following :-
> I need to write a program that monitors the use of a photocopier.
> Each member of staff is given a unique 4-digit PIN number and the
> machine keeps a count in a local binary disk file of how many
> photocopies have been credited to each pin. Periodically this file is
> downloaded to a PC where a program is run which creates a text file
> containing a report on the current use of the photocopier.

> The program must
> 1) Prompt the user for the name of the binary file.
>         The file consists of records, each with the following structure:-
>         Intals of person STRING[4]
>         PIN              INTEGER
>         Number of copies INTEGER

> I don't know how many records are in the file, but there should be no
> more than 50. If there are an error message should appear and the
> program should exit.

> 2) read in the binary file and create a text file called photocpy.txt
> containing the report. The records in the text file must be sorted in
> ascending order of number of copies.

> 3) prints a message to the screen, telling the user how many records
> were written to the text file, or if there were more than fifty records, warning the user that an error has occured.
> Here is an example of a report which might be written to the text file.

> name            pin             number of copies

> HCL             2899            53
> DDT             1864            2234
> AWOL            4852            8244

> I would be very greatful if someone could reply to me by e-mail with any suggestions or solutions.

Re:NEW USER NEEDS HELP


Quote
> Are you completely unable to do anything with this (homework)
> assignment except post it here, hoping some fool will do it for you?
> What we see in your post is _only_ the class assignment, but there's no
> evidence of any work on it by you.  It's clear you indeed "need help",
> but what's the benefit to you if we do your work and you hand in
> something which you can't explain or validate as your own?
>    This NG doesn't "do homework assignments" for students, and you
> should know that the only way to get help here is to post detailed
> questions (and code/design snippets) which (1) explain your problem
> fully and (2) show your efforts so far - so the help we offer will mean
> something to you and won't won't exceed you ability to understand it (a
> real possibility, since all manner and levels of students come here).
>    This problem is non-trivial, I admit, but where were you during the
> semester up 'til now?  Weren't you attending class and doing the other
> assignments?  (It appears not, since you seem totally helpless here...)
> I'd wager you must have had _some_ opportunity to (1) learn the
> background concepts (file i/o, records, output formatting, etc.) that
> such a problem needs and (2) discuss your difficulties with your
> instructor(s) before this - why come to this NG now?  Such a display of
> helplessness on your part does little to encourage sympathy or any
> desire to help you...

Don't you think you are being a little harsh here? I too am a Student
and often find that my friends have similar problems in grasping
assignments to begin with, I usually find however rather than balling
them out that a simple hint often helps put them on the right track, and
after all isn't that what this site is here for? For others who know
what to do help those who don't.

Yours Sincerely,

Gareth Tunley.

Re:NEW USER NEEDS HELP


Quote
> > Are you completely unable to do anything with this (homework)
> > assignment except post it here, hoping some fool will do it for you?
> > What we see in your post is _only_ the class assignment, but there's no
> > evidence of any work on it by you.  It's clear you indeed "need help",
> > but what's the benefit to you if we do your work and you hand in
> > something which you can't explain or validate as your own?
> >    This NG doesn't "do homework assignments" for students, and you
> > should know that the only way to get help here is to post detailed
> > questions (and code/design snippets) which (1) explain your problem
> > fully and (2) show your efforts so far - so the help we offer will mean
> > something to you and won't won't exceed you ability to understand it (a
> > real possibility, since all manner and levels of students come here).
> >    This problem is non-trivial, I admit, but where were you during the
> > semester up 'til now?  Weren't you attending class and doing the other
> > assignments?  (It appears not, since you seem totally helpless here...)
> > I'd wager you must have had _some_ opportunity to (1) learn the
> > background concepts (file i/o, records, output formatting, etc.) that
> > such a problem needs and (2) discuss your difficulties with your
> > instructor(s) before this - why come to this NG now?  Such a display of
> > helplessness on your part does little to encourage sympathy or any
> > desire to help you...

> Don't you think you are being a little harsh here? I too am a Student
> and often find that my friends have similar problems in grasping
> assignments to begin with, I usually find however rather than balling
> them out that a simple hint often helps put them on the right track, and
> after all isn't that what this site is here for? For others who know
> what to do help those who don't.

   Then what are the instructors/aides for?  Regardless of how you view
my reply to this person, this NG isn't a substitute for traditional
support forums when taking a class: the books, the syllabus, the
teacher, interaction with fellow students, etc.  One of the major
downsides of the Internet, it seems, is the misuse (abuse) of the good
will and extensive knowledge _experienced_ people here have: students
come to believe they can get _any_ sort of problem resolved via this
medium.  This has led to a constant barrage of (very young) students
doing nothing more than posting their assignments, verbatum, here,
hoping that someone will do their (overdue) work for them.  
   They further hope - not always with good reason - that those of us
who participate in this NG will understand the context and scope of the
literal assignment they posted.  This naive` hope can't realistically be
met, since no amount of experience we possess can compensate for the
classroom atmosphere which was the foundation of the task - a posted
program from this NG is often "spotted" as fraudulent, and we know there
_that_ will probably lead...
   As to "basic help", how can we do that, other than offer truly
remedial and pedantic advice?  Either the class has already dealt with
the basics of Problem Solving, or the prior exercises (which should have
been completed) would have created an adequate foundation.  Yes, a
totally lame class/instructor _could_ be at play here, but do we know
any of that?  Of course not, as the poster merely copied the assignment
here and offered nothing more.  Also, it's entirely likely that our
approach to working with the problem would be far beyond what the kid
knows or the teacher wants to be used - more components of the "problem"
we know nothing about.
   OTOH, I sometimes feel a bit a a "slap to reality" is as much as we
(I) should offer, since the (young) student really needs to face up to
what he/she's doing.  Note that I didn't call him/her rude names, but I
did attempt to get the person to realize how senseless the query was,
and why such requests have little business (and value) here.

Re:NEW USER NEEDS HELP


Quote
Mike Copeland wrote:

>   Then what are the instructors/aides for?  Regardless of how you view
> my reply to this person,

As I said in another message in the NG I don't think that you are wrong
or anything I just felt yesterday, (after having a hard time with one of
my own lecturers), that your reply was unduly harsh, of course I am only
a newcomer  to this NG and don't know what you have had to put up with
in the past and so can not judge your actions just from this reply, I
just felt what I said had to be said and couldn't go unsaid.

Quote
> this NG isn't a substitute for traditional
> support forums when taking a class: the books, the syllabus, the
> teacher, interaction with fellow students, etc.  One of the major
> downsides of the Internet, it seems, is the misuse (abuse) of the good
> will and extensive knowledge _experienced_ people here have: students
> come to believe they can get _any_ sort of problem resolved via this
> medium.  This has led to a constant barrage of (very young) students
> doing nothing more than posting their assignments, verbatum, here,
> hoping that someone will do their (overdue) work for them.

I totally agree with you here. I would only ever post an assignment here
if I had tried every other route available to me and when I did I would
post a sample of my code, if not all of it, so taht peopel can see that
I have tried and have some basis to help upon. I want to be a Programmer
or System Analyst when I am old enough and been to University here in
England, and have worked with computers and programming since I was five
so I well understand how annoying it cna get when people constantly
annoy you begging for help.

Quote
>    They further hope - not always with good reason - that those of us
> who participate in this NG will understand the context and scope of the
> literal assignment they posted.  This naive` hope can't realistically be
> met, since no amount of experience we possess can compensate for the
> classroom atmosphere which was the foundation of the task - a posted
> program from this NG is often "spotted" as fraudulent, and we know there
> _that_ will probably lead...

A friend of mine saw a program I was working on here at college and
liked the GUI so much that he nicked teh source code for his own
project, not noticing that there was a small module called that
displayed a message saying who had written the code. Revenge was sweet
and his project disallowed.

Quote
>    As to "basic help", how can we do that, other than offer truly
> remedial and pedantic advice?  Either the class has already dealt with
> the basics of Problem Solving, or the prior exercises (which should have
> been completed) would have created an adequate foundation.  Yes, a
> totally lame class/instructor _could_ be at play here, but do we know
> any of that?  Of course not, as the poster merely copied the assignment
> here and offered nothing more.  Also, it's entirely likely that our
> approach to working with the problem would be far beyond what the kid
> knows or the teacher wants to be used - more components of the "problem"
> we know nothing about.

Highly unlikely I agree,(the lame lecturer bit) but if they post the
assignment, say write a program to save an area of teh graphics display
wouldn't the most helpful bit of advice which could be given without
actually doing the work for them be to suggest a few comands to look up
in the help files such as PUTPIXEL and ASSIGN etc. It usually gets them
off your back and leaves you to do the project for yourself. The help
index really is so very terrifying if you haven't the slightest on what
commands to actually use.

Quote
>    OTOH, I sometimes feel a bit a a "slap to reality" is as much as we
> (I) should offer, since the (young) student really needs to face up to
> what he/she's doing.  Note that I didn't call him/her rude names, but I
> did attempt to get the person to realize how senseless the query was,
> and why such requests have little business (and value) here.

I hope that there will be no bad feelings over this exchange we
obviously agree to disagree on some points while agreing ,(though
perhaps I didn't make it clear enough in the first place), on most of
the others. I look forward to reading more of your messages and perhaps
I might be able to help you one day or vice-versa.

Yours With Gratitude for your reply,

Gareth Tunley

Re:NEW USER NEEDS HELP


Gareth Tunley <gareth.tun...@academic.eastdevon.ac.uk>
wrote:

Quote
>The help index really is so very terrifying if you haven't
>the slightest on what commands to actually use.

Hello Gareth,

I've enjoyed listening to your discussion w/ Mike. Don't
really have much to add to either side, but would like to
comment on the above.  Maybe my thoughts might help you and
some of the others that are looking our shoulder...

I would agree the help index can be a little intimidating at
times, and I also think the Programmer's Guide reads like an
encyclopedia.  But, If you don't use either, then the only
thing you can do is bug other people for solutions to even
the simplest problems.  You see Gareth, knowledge isn't
necessarily a measure of how much you know, but rather a
reflection on knowing where to get the information you need.

As someone recently said, when starting a new language the
documentation becomes _must_ reading that should be read
when commuting by bus, train, subway, or riding as a
passenger; it should be looked at while sitting on the
throne answering nature's call; and at other non demanding
times.  

The least you need to do is review what the language has to
offer.  If you don't know what is available then when it
comes time to do a simple task like display something on the
screen you wouldn't know whether you needed to use write,
print, print using, puts, fprint, say, ?, ??, or some other
equally obscure statement.  By familiarizing yourself with
what the language has to offer, you may at least remember
enough to know what to look for.

If you don't have access to the Programmer's Guide, then you
should at least use online help to read the description for
all functions and procedures.  In TP 4, 5, or 5.5 simply
place the cursor on a blank line and press Ctrl+F1. With TP
6 and 7 select help|contents.  Then review the help for
functions, procedures, and units.  You should also look at
the list of reserved words.  With TP 4 this only provides a
list of reserved words, but with 5 and above each words is
explained.

Once you've selected a list, highlight an item and press
enter.  When you've finished reading about that topic, press
Alt+F1 to return to the list where you can then select the
next item.  Once you've finished one list, review the next.

This exercise will probably be the single most important
thing you can do for yourself.  If nothing more, it will
have familiarized you with what is available.  Then when you
have a problem you might remember reading something, and
maybe, just maybe you might be able to help yourself rather
than be intimidated by the online help index.  ;-)

    ...red

BTW, commands are something we give to programs (operating
systems, editors, spreadsheets, etc), but when writing
programs, we use statements. ;-)

Re:NEW USER NEEDS HELP


Quote
R.E.Donais wrote:
> Gareth Tunley <gareth.tun...@academic.eastdevon.ac.uk>
> wrote:

> >The help index really is so very terrifying if you haven't
> >the slightest on what commands to actually use.

> Hello Gareth,

> I've enjoyed listening to your discussion w/ Mike. Don't
> really have much to add to either side, but would like to
> comment on the above.  Maybe my thoughts might help you and
> some of the others that are looking our shoulder...

> I would agree the help index can be a little intimidating at
> times, and I also think the Programmer's Guide reads like an
> encyclopedia.  But, If you don't use either, then the only
> thing you can do is bug other people for solutions to even
> the simplest problems.  You see Gareth, knowledge isn't
> necessarily a measure of how much you know, but rather a
> reflection on knowing where to get the information you need.

One bit of advice I'd pass on that helps me a lot when I need to find
something.  Cross-references.  The TP Programmer's Reference has them,
and they come in handy.

For instance, I've seen some posts asking questions like, "I need to
delete a file, but I can't tell how.  I looked up 'delete', but it
doesn't do what I want.  How do I do delete a file?"  Of course, the
delete() procedure is used to remove characters from a string.  So then,
how do you go about finding the answer on your own?  First off, don't
get hung up on "delete".  Try thinking more broadly.  Synonyms and
related ideas help greatly.  "Delete" is a file function.  Okay, what
other file functions can you think of?  Moving, copying, renaming.  Look
at move.  Nope.  Look at copy.  Another nope.  Look at rename.  AHA!
Read the description, then look down at the part that says "See Also
Erase".  Could it be?  Thumb over to "erase".  Eureka, that's it!  Oddly
enough, if you consider DOS, ERASE is an alias command to DEL.

Apply a little fuzzy thinking, and it won't be difficult to find what
you need.  The worst that can happen is that you pick up a few useful
tidbits between point A and point B.  ;-)

Quote
> [...]
>     ...red

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Re:NEW USER NEEDS HELP


In article <33573308.153932...@news.southeast.net> of Thu, 10 Apr 1997
23:38:47 in comp.lang.pascal.borland, "R.E.Donais"

Quote
<rdon...@southeast.net> wrote:
>I've enjoyed listening to your discussion w/ Mike. Don't
>really have much to add to either side, but would like to
>comment on the above.  Maybe my thoughts might help you and
>some of the others that are looking our shoulder...

>I would agree the help index can be a little intimidating at
>times, ...

This prompts a thought.

I (and I suspect a number of others) have used BP7, TP7, and earlier for
some considerable while, and have a pretty good idea of the identifiers
provided in the standard units.

Sometimes there is a need to convert a program, or compose one, to run
under Windows; one difficulty is that one may know perfectly well know
that in DOS mode one would want, say, "FileRec", without recalling that
the equivalent in WINDOWS mode is "TFileRec".  It is then difficult to
look up the equivalent in the Help...

Has anyone got a *.TPH file, a FAQ, a FTPable file, a Web page, etc.,
specifically designed for looking up DOS-mode identifiers and being told
the WINDOWS equivalents, near equivalents, alternative approaches, or
impossibilities?  Little more than a bilingual dictionary; one would use
the existing manuals or on-line Help once the necessary name was known.

If it has not been done, I could find space on www.merlyn.

--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web URL: http://www.merlyn.demon.co.uk/ -- includes FAQqish topics and links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)

Re:NEW USER NEEDS HELP


On Fri, 11 Apr 1997 02:10:33 -0700, Scott Earnest

Quote
<set...@ix.netcom.com> wrote:
> SNIP
>For instance, I've seen some posts asking questions like, "I need to
>delete a file, but I can't tell how.  I looked up 'delete', but it
>doesn't do what I want.  How do I do delete a file?"  Of course, the
>delete() procedure is used to remove characters from a string.  So then,
>how do you go about finding the answer on your own?  First off, don't
>get hung up on "delete".  Try thinking more broadly.  Synonyms and
>related ideas help greatly.
>SNIP

Also, for every unit, there is a help item called "procedure &
functions sorted by category" (or so). Looking around there helped
*me* a lot to get to know what is available and what is not.

Regards,
Marco
--
Marco Schmidt - Student of Computer Science, Aachen, Germany
mailto:ma...@pool.informatik.rwth-aachen.de
http://www.geocities.com/SiliconValley/Lakes/6686
PGP public key available on my web page - key fingerprint :
78 EC A5 87 34 56 F8 10  C2 6D AF A4 16 6C 08 76

Re:NEW USER NEEDS HELP


Quote
> >   Then what are the instructors/aides for?  Regardless of how you view my reply to this person,

> As I said in another message in the NG I don't think that you are wrong
> or anything I just felt yesterday, (after having a hard time with one of
> my own lecturers), that your reply was unduly harsh,

   Some times (and for some people who post here) it's necessary to be
"direct".  However, sometimes it's a matter of my reading the post at a
bad time (a systemic problem with these forums) - none of us get all the
sleep/rest we should...  8<}}

of course I am only

Quote
> a newcomer  to this NG and don't know what you have had to put up with
> in the past and so can not judge your actions just from this reply, I
> just felt what I said had to be said and couldn't go unsaid.

> > this NG isn't a substitute for traditional
> > support forums when taking a class: the books, the syllabus, the
> > teacher, interaction with fellow students, etc.  One of the major
> > downsides of the Internet, it seems, is the misuse (abuse) of the good will and extensive knowledge _experienced_ people here have: students
> > come to believe they can get _any_ sort of problem resolved via this
> > medium.  This has led to a constant barrage of (very young) students
> > doing nothing more than posting their assignments, verbatum, here,
> > hoping that someone will do their (overdue) work for them.

> I totally agree with you here. I would only ever post an assignment here
> if I had tried every other route available to me and when I did I would
> post a sample of my code, if not all of it, so that people can see that
> I have tried and have some basis to help upon.

   Precisely how it's supposed to be done, and this will garner the best
and most reasonable replies from the experienced participants here.
It's part of what's known as "Netiquette"...

Quote
> I want to be a Programmer
> or System Analyst when I am old enough and been to University here in
> England, and have worked with computers and programming since I was five
> so I well understand how annoying it cna get when people constantly
> annoy you begging for help.

   Lurking here will be useful to you - in many ways.  Lots of code and
solution postings, finding out how the {*word*62} world "works", viewing good
and bad examples of communication and temperment, etc.  One thing which
isn't explicitly taught in classes - but which I know to be
all-important - is the concept of all-around education: you will be
severely short-changing yourself is you focus only on programming and
technical skills, because the abilities to understand and express
yourself in various ways (verbally and orally) will be needed in
whatever you do vocationally (even if you work for yourself and develop
software products, you'll have to document and advertise your work).
You'll be well advised to devote full attention to the many "mundane"
academic subjects you'll face...as well as a variety of technical
subjects.

Quote
> >    They further hope - not always with good reason - that those of us
> > who participate in this NG will understand the context and scope of the
> > literal assignment they posted.  This naive` hope can't realistically be
> > met, since no amount of experience we possess can compensate for the
> > classroom atmosphere which was the foundation of the task - a posted
> > program from this NG is often "spotted" as fraudulent, and we know there
> > _that_ will probably lead...

> A friend of mine saw a program I was working on here at college and
> liked the GUI so much that he nicked teh source code for his own
> project, not noticing that there was a small module called that
> displayed a message saying who had written the code. Revenge was sweet
> and his project disallowed.

   Good example.

- Show quoted text -

Quote
> >    As to "basic help", how can we do that, other than offer truly
> > remedial and pedantic advice?  Either the class has already dealt with
> > the basics of Problem Solving, or the prior exercises (which should have
> > been completed) would have created an adequate foundation.  Yes, a
> > totally lame class/instructor _could_ be at play here, but do we know
> > any of that?  Of course not, as the poster merely copied the assignment
> > here and offered nothing more.  Also, it's entirely likely that our
> > approach to working with the problem would be far beyond what the kid
> > knows or the teacher wants to be used - more components of the "problem" we know nothing about.

> Highly unlikely I agree,(the lame lecturer bit) but if they post the
> assignment, say write a program to save an area of the graphics display
> wouldn't the most helpful bit of advice which could be given without
> actually doing the work for them be to suggest a few comands to look up
> in the help files such as PUTPIXEL and ASSIGN etc. It usually gets them
> off your back and leaves you to do the project for yourself. The help
> index really is so very terrifying if you haven't the slightest on what commands to actually use.

   Perhaps, but who's to say (from the information posted) how the
assignment should be tackled?  If the assignment is based on the most
basic Pascal being taught, and the fool turns in an elegant program
which uses graphics and uncalled-for system interfaces (color, sound,
whatever), such things will trumpet the artifice to the instructor, with
the sort of result you state above.  That's why I mentioned the
"context" of the assignment as being and important part of what should
be posted, since not all "correct solutions" are proper for the
assignment.

Quote
> >    OTOH, I sometimes feel a bit a a "slap to reality" is as much as we
> > (I) should offer, since the (young) student really needs to face up > > to what he/she's doing.  Note that I didn't call him/her rude names, but I
> > did attempt to get the person to realize how senseless the query > was, and why such requests have little business (and value) here.

> I hope that there will be no bad feelings over this exchange we
> obviously agree to disagree on some points while agreing ,(though
> perhaps I didn't make it clear enough in the first place), on most of
> the others. I look forward to reading more of your messages and > perhaps I might be able to help you one day or vice-versa.

   Well, your post _did_ come across as a typical
"stop-picking-on-the-students-all-they-want-to-do-is-LEARN" post, and I
was prepared to relegate your contributions to the "Twit" heap - so it's
a fine thing you clarified it as you did.  I respect that.  Thanks.

Re:NEW USER NEEDS HELP


Dr John Stockton <j...@merlyn.demon.co.uk> wrote:

Quote
>Sometimes there is a need to convert a program, or compose one, to run
>under Windows; one difficulty is that one may know perfectly well know
>that in DOS mode one would want, say, "FileRec", without recalling that
>the equivalent in WINDOWS mode is "TFileRec".  It is then difficult to
>look up the equivalent in the Help...

Thats exactly my problem. I bought Delphi to convert my DOS-programs to Windows,
but what documentation there is does not tell me how.

What would be needed is a reference manual for the windows library(s) of Delphi.
Unfortunately, not of the books on Delphi I looked at provides this sort of info either.

Other Threads