You are on page 1of 1

PRF192 Workshop2 and Workshop3 Test

Time: 60 minutes

Students use files: WK234.c to write following tasks and submit to the CMS system.

Q1 (3 points - workshop2): Write a function to calculate perimeter of square: P = 4 * a


Hint function prototype: double perimeterSquare(double a)

Q2 (4 points - workshop2): Write a function to print out list of NOT PRIME NUMBERS from
1 to N.
Hint function prototype: void printNotPrime(int N)

Q3 (3 points - workshop2): Write a function to print out the SHAPE as following:


Hint function prototype: void printShape(int N)

Q4 (3 points - workshop3): Write a function to print out the menu and accept user choice
as following:

Q5 (4 points - workshop3): Write a program that execute repeatedly using menu Q4 and
functions in Q1, Q2, Q3

Q6 (3 points - workshop3): Explains (walkthrough) how the code in comments part /* */


works (write directly in files WK234.c).

You might also like