Questions about Final Totals:
I want you to try to figure out the answers to these questions by looking at the following programs which are available at my web site under Final Totals:
Question #1using fintot: Explain what will appear on the total line when it is written.
Question #2 using fintot: What COBOL programming lines are used to accumulate the totals and where are they located in the program?
Question #3 using fintot: What paragraph is used to actually write the totals? What is done in that paragraph prior to writing the totals?
Question #4 using fintot: Explain why the line says:
       WRITE PRINTZ FROM TOTAL-LINE
           AFTER ADVANCING 2 LINES.
Instead of:
   WRITE TOTAL-LINE
            AFTER ADVANCING 2 LINES.
Question #5 using fintot1: Explain why the change made in fintot1 is okay.
Question #6 using fintot2: Where is the final total line set up and written in this program?
Question #7 using fintot3: Explain the changes that were made in this program?
Question #8 using fintot4: Could this program have the following command in B-200-LOOP? Explain your answer.
     WRITE PRINTZ
         AFTER ADVANCING 1 LINES.
Question #9 using fintot: The program fintot has the following data on the input file:
1234SUSAN SMITH 123 2345JOHN BROOKS 543 3456LINDA ANDERSON 456 4567DAVID LITCHFIELD 565
Look at the program and determine which output is correct. Briefly explain the problem(s) with the ones you did not select:
Choice A:
     1234          SUSAN SMITH                   123                               
     2345          JOHN BROOKS                   543                               
     3456          LINDA ANDERSON                456                               
     4567          DAVID LITCHFIELD              565   
                            
   TOTAL NUMBER OF RECORDS:     1,687              4
Choice B:
    1234          SUSAN SMITH                   123                               
    2345          JOHN BROOKS                   543                               
    3456          LINDA ANDERSON                456                              
    4567          DAVID LITCHFIELD              565
  TOTAL NUMBER OF RECORDS:   4                1,687
Choice C:
    1234          SUSAN SMITH                   123                               
    2345          JOHN BROOKS                   543                               
    3456          LINDA ANDERSON                456                               
    4567          DAVID LITCHFIELD              565   
  TOTAL NUMBER OF RECORDS:   4                1,297
Choice D:
    1234          SUSAN SMITH                   123                               
    2345          JOHN BROOKS                   543                               
    3456          LINDA ANDERSON                456                                
    4567          DAVID LITCHFIELD              565    
 
  TOTAL NUMBER OF RECORDS:   4                 
                         1,297
Question #10 using fintot3: The program fintot3.cbl uses the following input data:
1234SUSAN SMITH 123 2345JOHN BROOKS 543 3456LINDA ANDERSON 456 4567DAVID LITCHFIELD 565
Look at the program and determine which output is correct. Briefly explain the problem(s) with the ones you did not select:
Choice 1:
1234 SUSAN SMITH 123 1,230 2345 JOHN BROOKS 543 5,430 3456 LINDA ANDERSON 456 4,560 4567 DAVID LITCHFIELD 565 5,650 TOTAL NUMBER OF RECORDS: 4 1,687 16,870
Choice 2:
1234 SUSAN SMITH 1,230 123 2345 JOHN BROOKS 5,430 543 3456 LINDA ANDERSON 4,560 456 4567 DAVID LITCHFIELD 5,650 565 TOTAL NUMBER OF RECORDS: 4 16,870 1,687
Choice 3:
  
  1234          SUSAN SMITH                   123                               
  2345          JOHN BROOKS                   543                               
  3456          LINDA ANDERSON                456                               
  4567          DAVID LITCHFIELD              565   
                            
TOTAL NUMBER OF RECORDS:   4                1,687