pascal ?'s... 
Author Message
 pascal ?'s...

In a CASH REGISTER program, how can I name 50 -100 items, that are of Real
value, without having to assign 50 to 100 names to each of these values?
For example, if I wanted to total 50 -100 items, how would I give them all a
name?  What if the customer bought only 10, 30, or even 150 items from a
store.  How would I add them up?
OR, if i could send these 50 -100 items to a File as Reals, how would I read
and total these values?

Thanks!

Akshay



Wed, 18 Jun 1902 08:00:00 GMT  
 pascal ?'s...

Quote:

> In a CASH REGISTER program, how can I name 50 -100 items, that are of Real
> value, without having to assign 50 to 100 names to each of these values?
> For example, if I wanted to total 50 -100 items, how would I give them all a
> name?  What if the customer bought only 10, 30, or even 150 items from a
> store.  How would I add them up?
> OR, if i could send these 50 -100 items to a File as Reals, how would I read
> and total these values?

Use arrays:

var
  items : array[1..50] of real;

The individual items can be addressed by writing items[x], where x is an index
into the array between and including 1 and 50.



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

 Relevant Pages 

1. Pascal's Evaluation Order

2. MS Quick Pascal's Mouse Unit

3. MS Quick Pascal's Mouse Unit

4. Pascal's Triangle

5. Help:about Object pascal's Property.

6. Help Converting Pascal's .DAT files

7. Pascal's triangle

8. Standard Pascal ?'s

9. pascal 'real' data to vb 'double'

10. How to import a pascal 'Set' from a DLL to c++ ?

11. 'C' to PASCAL translator

12. Pascal to 'C' FAQ

 

 
Powered by phpBB® Forum Software