Break Processing

 

Minor Total exercise:

 

Positions

Type

Field Name

Field Description

1- 2

Char/text

DEPT

Department Number

3-7

Char/text

ITEMNO

Item Number

8-28

Char/text

ITEMNAME

Item Name

29-32

Number

ONHAND

On Hand

33-100

 

 

Other information we are not dealing with in this example

 

I am only going to show the data in the records on the file for the four fields we are using in this problem:

 

DEPT

ITEMNO

ITEMNAME

ONHAND

10

11111

Hammer

20

10

12345

Hand Saw

37

10

13456

Screw Driver

42

10

14567

Pliers

13

20

15678

Hoe

07

20

16789

Rake

19

20

17890

Trowel

03

30

20000

Hose

19

30

20001

Sprinkler

23

 

Your assignment is to think about what you would have to do to prepare a report.  The report should list the data, the totals of ONHAND by DEPT and the final total of ONHAND and answer the questions below.

 

As you do this, you are to play computer.  That is when you are looking at the records on the file, you cannot see the records you have already processed and you cannot see the records ahead.  Probably the best way to do this is to use index cards or slips of paper for each record.  Once you have turned over a card, you cannot see it again.  And you cannot see the other cards in the deck.

 

Think about these problems and then send me your answers:

 

  1. You are accumulating totals for a department.  When you turn over a index card and start a new index card, how do you know whether the new card is in the same department or a different department?  What do you have in your memory that tells you?  How do you put this in the computers memory?
  2. When the department changes, what do you need to print out to show both the total of on hand and the department number for that department?  Where do you get that information?
  3. When you finish printing out a department, what do you have to reset before starting another department?  What are you going to reset them to and how are you going to do this?
  4. When you reach EOF - in this example, when you have processed the record for the Sprinkler, what needs to be done?  Be specific about what needs to be printed and where you get the information.
  5. Show me a sample report that would include the data shown above, minor totals for each depart and a final total.