Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

PRF192 Workshop2 and Workshop3 Test

Time: 60 minutes
Students use files: WK231.c to write following tasks and submit to the CMS system.

Q1 (3 points - workshop2): Write a function to calculate formula: y = x*a + b.


Hint function prototype: double y(double x, double a, double b)

Q2 (4 points - workshop2): Write a function to print out list of EVEN FIBONACI NUMBERS
from 1 to N.
Hint function prototype: void printEvenFibonaci(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 WK231.c).

You might also like