Bitlab 4
Bitlab 4
Lab activity 07
Function 1
Objective:
Learning of: -
1. Able to identify Function type
2. Basic function
Instructions:
1. In group of max 5 members
2. Write all the group members name and matric number in cover page.
3. Submit HARDCOPY before 15 December 2022, 5pm to my room (PB302-04).
Question 1
Write a header for the following functions;
1. Function name fun1() that receive 2 int parameters and returns a type float to calling
function.
2. Function name fun2() that receive 2 int parameters and doesn’t not returns anything to
calling function.
3. Function name fun3() that don’t receive any parameters and returns a type float to calling
function.
4. Function name fun4() that don’t receive parameters and doesn’t not returns anything to
calling function.
Question 2
Rewrite the Program 1 by creating 2 function namely as top() and bottom(). The top()
function is used to display to roof and the bottom() function used to display the bottom house.
Program 1
BIT10303 COMPUTER PROGRAMMING
FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
1st Semester 20222023
Question 3
For each program 2 until program 5 write
Program 2
BIT10303 COMPUTER PROGRAMMING
FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
1st Semester 20222023
Program 3
Program 4
BIT10303 COMPUTER PROGRAMMING
FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
1st Semester 20222023
Program 5
- end of questions -