Beruflich Dokumente
Kultur Dokumente
PROJECT
Name
Reg. No.
Topic Topic 2: Problem Solving Methods
Topic 3: Fundamentals of Programming Language
Topic 4: Basic Programming Codes Marks
/50
CLO 3C: Solve problems by applying related theories of the basic programming technique to a
given particular scenario using programming life cycle. (C4, P3, A2, PLO1, PLO2, PLO4, PLO6)
/30
CLO 3P: Solve problems by applying related theories of the basic programming technique to a given
particular scenario using programming life cycle. (C4, P3, A2, PLO1, PLO2, PLO4, PLO6)
Question:
The electric tariff for residential unit is calculated monthly using the following table:
Block Tariff (kWh) Rate (RM)
For consumers with monthly consumption of more than 300kWh, there is a subsidy of RM 0.0152
/kWh applicable to the consumer’s bill. The bill includes name, address and bill date
1. Identify the input, process and output (15 markah) [CLO 3C]
2. Write algorithm, flow chart and pseudo code for the following requirements by analyzing
and applying the problem solving step to solve the problem (35 markah) [CLO 3C]
3. Develop a program to calculate total electricity bill for the usage of 432 kWh and print screen
the output. The output must include the following items: (30 markah) [CLO 3P]
a) Consumer name
b) Address
c) Bill date
d) Amount of block tariff usage
e) Total subsidy
f) Total bill
POLITEKNIK TUANKU SYED SIRAJUDDIN
DFC1042 – PROBLEM SOLVING AND PROGRAM DESIGN
PROJEK
Topic 2: Problem Solving Methods
Topic Topic 3: Fundamentals of Programming Language
Topic 4: Basic Programming Codes Markah
/50
CLO 3C: Solve problems by applying related theories of the basic programming technique to a
given particular scenario using programming life cycle. (C4, P3, A2, PLO1, PLO2, PLO4, PLO6)
/30
CLO 3P: Solve problems by applying related theories of the basic programming technique to a given
particular scenario using programming life cycle. (C4, P3, A2, PLO1, PLO2, PLO4, PLO6)
Soalan:
Tarif elektrik untuk unit kediaman dikira setiap bulan menggunakan jadual berikut:
Blok Tarif (kWh) Kadar (RM)
200 unit pertama 0.218
100 unit seterusnya 0.334
300 unit seterusnya 0.516
Bagi pengguna dengan penggunaan bulanan melebihi 300kWh, terdapat subsidi RM 0.0152 / kWh
yang terpakai bagi bil pengguna. Bil tersebut mengandungi nama, alamat dan tarikh bil
Answer schema
Input:
consumer_name
address 1 mark
bill_date
unit_used
Process:
If usage more than 200 but less than 300: -------------------------------------------------- 1 mark
amount=43.60 +((unit_used-200)*0.334) ---------------------------------------- 3 marks
Output:
consumer_name
address 1 mark
bill_date
unit_used
subsidy
1 mark
total_bill
(Total marks 15 m)
POLITEKNIK TUANKU SYED SIRAJUDDIN
DFC1042 – PROBLEM SOLVING AND PROGRAM DESIGN
Algorithm
Step 1: Input name, address, bill date and amount of block tariff 1 mark
Step 2: If block tariff used less than or equal to 200, amount = unit*0.218 2 marks
Step 3: If block tariff used more than 200 but less than 300, 1 mark
amount =43.60 +((unit-200)*0.334) 3 marks
Step 5: Print name, address, bill date and amount of block tariff, 2 marks
Subsidy, total bill
Pseudo Code
(Total marks 10 m)
POLITEKNIK TUANKU SYED SIRAJUDDIN
DFC1042 – PROBLEM SOLVING AND PROGRAM DESIGN
Flow Chart
0.5 mark
Start
true
1 mark unit_used < 200
1m
false amount=unit*0.218
true
1 mark unit_used < 300
1 mark
false amount= 43.60 + ((unit_used -200)*0.334);
End
0.5 mark
Source Code
Berupaya membuat
Berupaya membuat
Tidak boleh membuat Berupaya membuat Berupaya membuat keputusan yang sangat
keputusan yang
Proses membuat keputusan berasaskan keputusan yang lemah keputusan yang baik baik dengan
memuaskan berasaskan
keputusan maklumat, idea dan berasaskan maklumat, berasaskan maklumat, mengambilkira
maklumat, idea dan
penyelesaian walaupun idea dan penyelesaian idea dan penyelesaian maklumat, idea dan
penyelesaian yang sedia
dengan bantuan. yang sedia ada . yang sedia ada. penyelesaian yang sedia
ada.
ada.
POLITEKNIK TUANKU SYED SIRAJUDDIN
DFC1042 – PROBLEM SOLVING AND PROGRAM DESIGN
TOTAL /24