0% found this document useful (0 votes)
33 views4 pages

Bitlab 4

This document outlines a lab activity on functions for a computer programming course. It contains 5 questions to help students learn about different types of functions. Question 1 asks students to write headers for functions that either receive parameters and return values, or don't receive parameters and return nothing. Question 2 asks students to rewrite a program using two functions - one to display the roof and one to display the bottom of a house. Question 3 asks students to analyze 5 programs by identifying their output, function type, prototype, call, and definition. The document provides guidance to students on an assignment to submit examples of functions.

Uploaded by

AMAR ZAMANI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views4 pages

Bitlab 4

This document outlines a lab activity on functions for a computer programming course. It contains 5 questions to help students learn about different types of functions. Question 1 asks students to write headers for functions that either receive parameters and return values, or don't receive parameters and return nothing. Question 2 asks students to rewrite a program using two functions - one to display the roof and one to display the bottom of a house. Question 3 asks students to analyze 5 programs by identifying their output, function type, prototype, call, and definition. The document provides guidance to students on an assignment to submit examples of functions.

Uploaded by

AMAR ZAMANI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BIT10303 COMPUTER PROGRAMMING

FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY


UNIVERSITI TUN HUSSEIN ONN MALAYSIA
1st Semester 20222023

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

i. the program output


ii. function type
iii. function prototype
iv. function call
v. function definition

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 -

You might also like