Spring 1998
Assignment 4
(due Friday 98.02.27 at 5 p.m. in room MCS 138)
-
[4 points] Exercise 5.16, page 195.
Your program must satisfy the following requirements:
- It must include a main function, which in turn
calls the integerPower function.
- It should read a pair of non-negative integers from the
keyboard.
- You should run it on the following pairs of integers:
(2,7), (3,6), (4,5), (5,4) and (6,3).
-
[4 points] Exercise 5.37, page 198.
Your program must satisfy the requirements of the preceding exercise.
-
[4 points] Exercise 5.19, page 195.
Your program must satisfy the following requirements:
- It must include a main function, which in turn
calls a function called squareFigure.
- It should read a value for the integer parameter
side from the keyboard.
- You should run it on the following values of
the parameter side: 4, 8 and 10.
-
[4 points] Exercise 5.20, page 195.
Your program must satisfy the following requirements:
- It must include a main function, which in turn
calls a function called squareFigure.
- It should read a value for the integer parameter
side and for the character parameter
fillCharacter from the keyboard.
- You should run it on the following values of
the parameters side and fillCharacter:
8 and *, 8 and #, 8 and +.
Assaf Kfoury
Created: 98.02.19