Algoma University College

Computer Science 3127

Programming Languages

Fall 1996/97

Assignment #3

Pawan Lingras

Date Due: Week 7

Use a word processor and give your submissions a professional look.

  1. Write an essay to discuss parameter passing and value returning mechanisms in imperative languages. Also describe the results of a program assuming parameters to swap are passed using various parameter passing mechanisms:

void main()

{

int a[20], j;

j = 2; a[j] = 99;

swap(j,a[j]);

}

  1. Write a function called timed that takes two parameters n of the type integer and pointer to a function called work. The function work is a void function that accepts one parameter of the type integer. The function timed returns the time required to execute work by passing n to it. Test the function timed for a single loop and nested loops. Refer to data structures assignments.