Welcome to Grade A's Online Tutoring

Version for Tutoring Assistance at Tradition Dorm Version 1.1

   
 

CPSC 110 - Sample Programs

Below are some sample programs written by Brent Dingle. They cover many of the 'basic' programming task implementations.
They are all (c)opyright Brent M. Dingle 2001, 2002.
  • howdy.pas -- A simple program
  • truntest.pas -- Truncation vs. rounding test program
  • sqrt1.pas -- Demo of the sqrt function


  • maketext.pas -- Program to demo file OUTPUT
  • readtext.pas -- Program to demo file INPUT
  • read_in.txt -- Text input file for readtext program
  • askread.pas -- Program that reads input from a file AND prompts for filename
  • loopread.pas -- Program to read from a file using a while-loop COUNTER
  • loop_in.txt -- Text input file for loopread program
  • eofread.pas -- Program to read from a file using a while-loop EOF check
  • eof_in.txt -- Text input file for eofread program


  • sumthem -- Program which sums 5 numbers.
  • readsum -- Program which reads 5 numbers from a file and sums them.
  • readsum2 -- Program which reads 5 numbers AND a name from a file and sums the numbers.
  • readsum3 -- Same as ReadSum2 but reads arbitrary number of records and outputs to a file, also has a Header.


  • multtab.pas -- Program to demonstrate nested loops


  • arty.pas
    -- Program to demonstrate why params should be used
    -- Program asks for student name and 5 scores and calc's avg and letter grade.
  • notsoart.pas
    -- Program to demonstrate why params (and arrays) should be used
    -- Program asks for instructor's name, course name, (3) student names and (5) scores and calc's avg and letter grade.
  • rainbow.pas -- Program to demonstrate enumerated types and pred/succ.
  • rainbow2.pas -- Program to demonstrate enumerated types and ord/chr.
  • ez_sort.pas -- Program to demonstrate a simple name sorting program.


  • rooms.pas -- Program to demonstrate parallel arrays and arrays of arrays (also a small maze game).
  • rooms.exe -- The DOS executable of rooms.pas (compiled and tested on Windows 2000 platform).
  • hint_tic0.pas -- Program (incomplete) to help you write a NO ARRAY version of Tic Tac Toe.
  • hint_tic1.pas -- Program (incomplete) to help you write a 1-dim array version of Tic Tac Toe.
  • hint_tic2.pas -- Program (incomplete) to help you write a 2-dim array version of Tic Tac Toe.


  • par_arry.pas -- Program to demonstrate a parallel array implementation.
  • rec_grad.pas -- Program to demonstrate a record implementation. Contrast this with par_arry.pas.
  • par_arry.txt -- Sample input file for par_arry.pas and rec_grad.pas program.

  • parallel.pas -- Parallel array prog - names and grades and letter grades.
  • alpha.pas -- Program using parallel arrays and names - alphabetizes the names.
  • in7.txt -- Sample input file for parallel.pas and alpha.pas.




To return to the main index page try this.