Prev Up Next
Go backward to 4.4 Run a COBOL program
Go up to 4 Labs
Go forward to 4.6 Fortran program

4.5 Pascal program compile and run

Pascal is a programming language that was designed for teaching programming.
  1. Compile the PASCAL program (TRIP.PAS) you created in Lab 4.3 The /LIST will create an optional listing file (TRIP.LIS).
     
    $ pascal trip /list
    
  2. If you have errors (probably, I asked you to leave in some problems), correct the original source (TRIP.PAS from Lab 4.3 with the editor and go back to step 1. You may find it easiest to print TRIP.LIS and find your errors in the list file.
  3. Link the .OBJ file created in step 1.
     
    $ link trip 
    
  4. Execute the .EXE file and answer the prompts with the following data:
     
    $ run trip
     
    Distance:           200 
    Average speed:      55 
    Miles per gallon:   20 
    Cost per gallon:    1.29
    
  5. Delete the .OBJ and .EXE files no longer needed.
     
    $ delete trip.obj;*, trip.exe;* 
    
  6. Purge and print the final listing file (TRIP.LIS) with delete.
     
    $ purge trip.lis
    $ print/delete trip.lis
    
On the print out from step print the following:
Your-Name
Lab 4.5: Pascal compile and run
TABER CSC135
Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Prev Up Next