Академический Документы
Профессиональный Документы
Культура Документы
Semester I 2017-2018
Dosen: Petrus Santoso
LAB. SESSION 04
Objectives:
• Student have understanding about input, output and control structure and
function
• Student have a chance to try some code examples. Student can type, compile,
execute the given code examples and analyze the results.
Description:
Topic:
Scope:
Result Description:
Please write your answer, the screen shot of program’s result using a word processing
program like Microsoft Word. Combine your answer with all your program code
(CodeBlocks project) in a single .zip file. Name your file as Lab04_NRP_FirstName. NRP
and FirstName should be replaced according to student identity.
Grading Criteria:
A
Finish more than 85% of the problems correctly
B
At least finish 75% of the problems correctly
C
At least finish 50% of the problems correctly
D/E
Work on less than 50% of the problems
1. What is the definition of function? Give the advantages of using function! Explain the
procedure of writing a function!
2. What is function prototype? Give explanation about the following function prototype!
c. char fn (void);
4. Write the first line of function definition, including the argument declaration for the
following constraints:
A Mickey Mouse doll has the following components: head, body, 2 hands and 2 feet. A
Minnie Mouse doll has the following components: hair ribbon, head, body, 2 hands,
and 2 feet.
The production time of each components are as follow: head and body need 3 minutes
each, hair ribbon need 1,5 minutes, hand and foot need 1,25 minutes each.
Create a structured program (with function) to calculate the amount of time needed
to produce order from customers! Input of the program: the number of order
(Mickey Mouse and Minnie Mouse dolls). Output of the program: Needed time to
finish the order. (Note: Display the needed time in the form of day, hour and minute).