In The Name of Allah, The Most Beneficent, The Most Merciful
In The Name of Allah, The Most Beneficent, The Most Merciful
In The Name of Allah, The Most Beneficent, The Most Merciful
ICT DEPARTMENT
CENTRE FOR FOUNDATION STUDIES, IIUM
SEMESTER 3, SESSION 2013/2014
25
SEF1514 COMPUTER 2
QUIZ 1
_________________________________________________________________________
GROUP #:
_________________________________________________________________________
Question No. 1 2 3 4 5
Answer D C A C D
1. Which is the correct order for the five steps of Program Development Life Cycle
(PDLC) in programming?
A. Input, Requirements, Process, Design, Implementation
B. Output, Design, Implementation, Analysis, Maintenance
C. Design, Implementation, Testing, Verification, Maintenance
D. Requirements, Design, Implementation, Verification, Maintenance
Trace the changes of values for all identifiers and then show the output for the following program
segment.
#include<stdio.h>
int main()
{
int x = 3, y = 5, z = 6;
z += y++ *3 - x;
system("pause");
return 0;
}
Answer:
Output:
A group of students and several accompanying teachers are joining a school visit to a zoo.
The ticket is sold at a fixed price (RM 15.00 for kid and RM 20.00 for adult). 20% discount is
given by the zoo management for any educational activity and 10% of the total ticket price
will be donated to Rumah Yayasan Bakti as sadaqah. Write a program to calculate the
amount of ticket price and sadaqah. Ask the user for the number of students and teachers.
Sample output:
Flowchart (5m)
1m
Input no. of students and teachers
Calculate sadaqah=
discounted ticket price * 10%
Stop
Source codes (10m)
#include <stdio.h>
int main()
{
int student, teacher;
float sadaqah, price, dis_price; //declaration 1m
system("pause");
return 0;
}