Algoma University College
Computer Science 3127
Programming Languages
Fall 1996/97
Assignment #4
Pawan Lingras
Date Due: Week 9
Use a word processor and give your submissions a professional
look.
- Compare and contrast templates and polymorphism.
- Discuss advantages of throwing an exception as opposed to
returning an error code.
- Create a template of a stack with constructor, destructor,
pop, push, and peek operations. Use a class called stack_error
and two derived error classes stack_full and stack_empty. Write
two different functions that pump in numbers in a stack of integers
until the stack is full and pump out numbers from the stack until
stack is empty. In one function, catch stack_error exceptions
in the other catch the stack_full and stack_empty exceptions individually.
Assignment #5
Pawan Lingras
Date Due: Week 10
- Represent the following facts as prolog rules:
- Math3056 is the hardest mandatory class in COSC program
- Cosc3016 is the second hardest mandatory class in COSC program
- Other mandatory classes include Cosc1046, Cosc1047, Cosc2006,Cosc2007
- Joe found Cosc3016 easy
- Run ALS-Prolog to answer the question what other classes did
Joe find easy.
- Explain how prolog arrived at the answer(s).