Bcs1023-Programming Techniques 1415

You might also like

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

Universiti

Malaysia
PAHANG

Engineering Technology Creativity

FACULTY OF COMPUTER SYSTEMS & SOFTWARE ENGINEERING


FINAL EXAMINATION
COURSE

PROGRAMMING TECHNIQUES

COURSE CODE

BCS1O23

LECTURER

ADZHAR BIN KAMALUDIN


SURYANTI BINTI AWANG

DATE

22 JUNE 2015

DURATION

3 HOURS

SESSION/SEMESTER

SESSION 2014/2015 SEMESTER II

PROGRAMME CODE

BCSIBCNIBCG

INSTRUCTIONS TO CANDIDATE:
1.
2.
3.
4.

This question paper consists of THREE (3) questions. Answer ALL questions.
Write your answers in the answer booklet provided.
Answer EACH question on a new page.
All calculations and assumptions must be clearly shown.

EXAMINATION REQUIREMENTS:
NONE
DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO
This examination paper consists of SIX (6) printed pages including the front page.

CONFIDENTIAL

QUESTION 1

BCS/BCNII3CG/1415111BCS1023

[20 Marks]

A log file for network access for a particular day by UMP students from their college is shown in
Figure 1. The log file consists of information of the college, start time and end time of the access
and the data type of the access. The start time and end time is recorded using 24-hours clock
system. ICT Centre of UMP has to produce a report as their daily task. The report consist of
college name, total time access per college and total cost per college. The cost is calculated by
multiplying the access duration and the datatype. If the data type is A, which is audio, the cost is
RMO.20 per minutes. If the data type is V, which is video, the cost is RMO.35 per minutes. If the
data type is T, which is text, the cost is RMO.01 per minutes.

COLLEGE

STAP.TTIME

ENDTIME

DATATYPE

KK2
KK1
KK2
KK5
KK3
KK4
KK2

00:12
00:13
00:20
01:53
02:12
02:33
04:32
04:43
06:12
07:44
10:20
11:23
16:12
17:13
18:20
19:23

00:20
00:35
01:34
03:35
00:20
00:35
05:34
06:35
06:20
08:35
11:34
11:35
16:20
18:35
19:34
22:35

1<1<5
1<1<2
1<1<1

1<1<3
1<1<4
1<1<3

KK1
KK2
1<1<5

V
T
T
A

V
T
T
A

V
T
T
V
A

T
V

Figure 1: Log file for Network Access


Based on above problem, develop a complete program using modular programming, array, file
processing or any appropriate technique to produce the report that required by ICT Centre of
UMP.

BCS/BCNIBCG/1415111BCS1023

CONFIDENTIAL

QUESTION 2

[40 Marks]

Storm Rider Book Rental Enterprise is providing online system for comic book rental. Customer
is allowed to rent up to 5 books only, otherwise, the system will trigger a message "Only 5 books
are allowed to be rented at one time ". The system also will display a list of comic books that are

available to be rented in the system's menu along with their rental fees as shown in Table 1.
Figure 2 is an example of the system's output.
Table 1: List of Books
No.
1
2.
3.
4.

Title
Pedang
setiawan
Dewata Raya
Golok Keramat
Pendekar Laut

Series

Price

Title

No.

Series

Price

1-620

5.

Naga Kembar

1-101

1-160
1-99
1-110

2
2
2.50

6.
7.
8.

Alam Perwira
Dragon Ball
Doraemon

1-400
1-29
1-20

2
3.5
3.5

Task:
Write a complete program using modular programming, array, file processing or any appropriate
technique for the above problem. You may refer to Table 1 as a guideline for input process and
Figure 1 for the output. The output must be produced in a file.

CONFIDENTIAL

BCSIBCNIBCG/1415111BCS1023

Enter Customer Name: Nabil Johari


Enter Customer ID: M005
List Of Title

Series

Rental Fees

1. Pedang setiawan
2. Dewata Raya
3. Golok Keramat
4. Pendekar Laut
5. Naga Kembar
6. Alam Perwira
7. Dragon Ball
8. Doraemon

1-620
1-160
1-99
1-110
1-101
1-400
1-29
1-20

2
2
2
2.50
2
2
3.5
3.5

Enter your comic choice or press 0 to exit? 1


Enter series [1-620] : 621
Not valid, Enter valid series [1-620]: 35
Enter your comic choice or press 0 to exit? 3
Enter series [1-99]: 80
Enter your comic choice or press 0 to exit? 6
Enter series (1-4001: 67
Enter your comic choice or press 0 to exit? 0

Storm Rider Book Rental Enterprise


Name
Customer ID

:Nabil Johari
:M005

Comic Books

Series

Rental Fees (RN)

Pedang setiawan
Golok Kerarnat
Alam Perwira

35
80
67

2.00
2.00
2.00

sub total
+Postage fees
+GST 6%

6.00
1.00
0.42

Total:

7.42

Return period: 7 days


Thank you, the requested comic books will be sent to your address
the next following working day

Figure 2: Sample of output of the program.

CONFIDENTIAL

QUESTION 3

BCSIBCNIBCG/1415IIJBCS1023

[40 Marks]

Inland Revenue Board (IRB) proposed a new initiative for combining husband-wife annual
income declaration. The current practice of annual income declaration is done individually by the
husband and wife as shown in Figure 3. IRB will give new tax rate of 2.5% for this initiative..
Individual Annual Income Declaration

Individual Annual Income Declaration

Husband ID: H12317

Wife ID: W00145

Type of Income

Amount

Type of Income

Amount

Salary

76,000.34

Salary

56,434.40

Allowance

23,023.45

Allowance

3,289.45

Other Incomes

12,123.12

Other Incomes

2,123.12

Total Income (a)

111,146.91

Total Income (a)

61,846.97

Type of Expenses

Amount

Type of Expenses

Amount

Family

12,000.00

Family

12,000.00

Education

3,400.13

Education

405.53

Health

2,345.12

Health

345.62

Total Expenses (b)

17,745.25

Total Expenses (b)

12,751.15

Taxed Amount (a-b)

93,401.66

Taxed Amount (a-b)

49,095.82

Percentage of Tax
Amount of Tax

Percentage of Tax

7.5%
7005.12

Amount of Tax

(a) For husband

7.5%

3682.19

(b) For Wife

Figure 3: Annual income declaration


Task
Write a complete program using modular programming, array, file processing or any appropriate
technique for the above problem by reading the necessary input with the related calculation of
the tax as shown in Figure 3. Then produce a report that shows calculation of the tax based on
the new initiative. Example of the report is shown in Figure 4. You must apply at least two
functions.
5

CONFIDENTIAL

BCS/BCNIBCG/141511113CS1023

Combine Annual Income Declaration


Husband

Wife

ID: H12317

ID: W00145

Type of Income

Amount

Amount

Salary

76,000.34

56,434.40

Allowance

23,023.45

3,289.45

Other Incomes

12,123.12

2,123.12
Total Income (a)

Type of Expenses

Amount

Amount

Family

12,000.00

12,000.00

Education

3,400.13

405.53

Health

2,345.12

345.62

Total

17,2993.88

Total Expenses (b)

30,496.40

Taxed Amount (a-b)

142,497.48

Percentage of Tax (2.5%)


Amount of Tax
Figure 4: Combine Annual Income Declaration

END OF QUESTION PAPER

2.5%

3562.44

You might also like