Help with programming! 
Author Message
 Help with programming!

Being entirely new to the Internet, does anyone know how to write a simple
program in Pascal to do the following:

Set up a datafile
Read the datafile
Print the datafile in the following manner:

Put data into an array where there are four columns, as follows:
        1st     2nd     3rd     Sum
        ---     ---     ---     ---
        ---     ---     ---     ---    
        ---     ---     ---     --- and so on...

Where the data are put into 1, 2, and 3 and are then added to make the sum
(the fourth row),  then this process is repeated for the next line, and so
on until all the data are used up or "read out", this being done in a
random order.  The last step is to print it out.

How do you establish that you have reached the end of the datafile when it
is random?
How do you set a variable that one can use for the data and the program
knows that it has already "used up" that particular value?
How do you establish the place value for the matrix--would it be x,y with a
progression from 1,1 or 0,0 to n, n?

I was heavy into mathematics some years ago but never got to take any
computer programming, and I mean none, zero.

I envy you people who know this stuff.   Can you show me how to write this
program?   Should I be using another language?

Thanks for your help!  

By the way, if you are male, you should be giving {*filter*} regularly (at least
three times a year) to get your excess stored iron level down to that of
premenopausal females, then you will be totally protected against coronary
heart disease like they are....cancer too.  Iron is an incredibly



Wed, 18 Jun 1902 08:00:00 GMT  
 Help with programming!


Quote:
>How do you establish that you have reached the end of the datafile when it
>is random?

Use "While Not EOF(Infile) do..", this will tell you when you are at the end
of the file.  Alternatively, if you have a binary file, or a text file where
all the records are the same length, you could also calculate the number of
records by dividing the file size by the size of each record.

Quote:
>How do you set a variable that one can use for the data and the program
>knows that it has already "used up" that particular value?

Some more specifics on what kind of data you have would help, but you could
either put a flag value in the matrix that would indicate that the slot was
"available" (for instance use -1 if your values were by definition greater
than zero).  Alternatively, you could make a boolean flag matrix of the same
size, and then flip the flag state in that matrix when a value was used.

Quote:
>How do you establish the place value for the matrix--would it be x,y with a
>progression from 1,1 or 0,0 to n, n?

X,Y, Row, Column: Shouldn't really matter, use what is most natural
abstraction for your problem.

Quote:
>I envy you people who know this stuff.   Can you show me how to write this
>program?   Should I be using another language?

Pascal is fine.

brian



Wed, 18 Jun 1902 08:00:00 GMT  
 Help with programming!

Well Tom,

All this would be possible. But as i can see you lack very much basic
priciples of programming. It's not so easy to learn you in a five line
mail-message. There are however lots of books on the market which will
cover this problems. There is also a pascal course on the net by Timo
Salmi. Look for him.

Cheers,
Anco.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need HELP FINISHING PROGRAM (posted program) PASCAL

2. HELP!!! please help with program

3. HELP ME PLEASE I NEED HELP ON PROGRAMMING THIS>>>>|||

4. help with program needed please

5. Need help for Program!!!

6. need help on programming 3d graphics.

7. Help with Program Please

8. Help with Program Please

9. NEED HELP ON PROGRAMMING~~~

10. Help testing program

11. Free help for programming students web page

12. newbie cry please help first program

 

 
Powered by phpBB® Forum Software