Prev Up Next
Go backward to 4.5 Enter a PASCAL program
Go up to 4 Labs
Go forward to 4.7 The "C" Language

4.6 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.5 The /LIST will create an optional listing file (trip.pas).
     
    gpc -o trip trip.pas
    
  2. If you have errors (probably, I asked you to leave in some problems), correct the original source (trip.pas from Lab 4.5 with the editor and go back to step 1.
  3. Execute the trip file and answer the prompts with the following data:
     
    trip
     
    Distance:           200 
    Average speed:      55 
    Miles per gallon:   20 
    Cost per gallon:    1.29
    
  4. Printout your run. To do this use the following commands:
     
    trip | tee temp
    lpr temp
    
On the print out from step print the following:
Your-Name
Lab 4.6: 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** My new Home on phRed** The Pima College Site** The Mad Dr. G.'s home page on phred.

Prev Up Next