The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by farihin02, 2020-08-06 11:26:49

DC024 Pra PSPM KMK 2020

DC024 Pra PSPM KMK 2020

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

1. An algorithm is a step-by-step instruction that will transform the input into the output. The
algorithm is the abstract idea of solving a problem.

a) Define the purpose of problem analysis. [2 marks]

...........................................................................................................................................
...........................................................................................................................................

2. Create an IPO chart based on the problem given below.

a) (i) Calculate and output the weekly salary if the rate is RM 25 per hours.
[3 marks]

(ii) The staff of HEP Unit need to find the total of module 1, module 2 and

module 3 students who have attend the Local Rule Seminar. The program should

also find the percentage of attendent for each module. The total of the

participants are 100 students. [4 marks]

b) (i) Azila ask her roomate to create a program that will accept number from

user and tells the user that a negative number was entered. [3 marks]

1|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

(ii) Calculate and print the average of student age for the class P3T7 which consist
of 30 students.
[4 marks]

c) (i) Create a program that will accept student’s name, age and CGPA. If the

student’s CGPA is above 3.00, the program will print a message “You

are eligible to take a master’s programme”. Otherwise print a message

“You are not eligible to take a master’s programme”. [4 marks]

(ii) start
input semester, hour
if (semester > 4)
input hour
practical_allowance = hour * 1.50
display practical_allowance
else
display “ You are not eligible”
end if

stop

[4 marks]

2|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

d) Given the marks of students based on the number of students in a class. Write a

program that contains 2 options. If the user enters 1, the program finds the highest

and lowest marks in the class. If the user enters 2, the program will find the number

of students who pass and fail. The passing mark is 50. [4 marks]

e) A program will determine the lowest temperature in a week. [3 marks]

f) Create an IPO that will accept input age, height and weight for some student. The

loop will stop when the user enters value 0 for age. Calculate the average for age,

height and weight. Print the number of people and the average age, height and

weight. [6 marks]

3|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

3. Madam Hasnizah is planning for a vacation to Kuala Lumpur with her family. Write a

pseudocode to help her calculate the total ticket price of Electric Train Service (ETS) based

on the table below. Assume that she will choose the same ticket class for the whole family.

[10 marks]

Ticket Class Price (RM) Service Charge

Adult 70

Gold Child (Below 13) 39

Senior Citizen (Above 59) 39 5%
Adult 93

Platinum Child (Below 13) 51

Senior Citizen (Above 59) 51

4|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

4. Kembara Sejalanan Club would like to distribute their members into three groups based on
their years of experience as shown in the table below:

Years of Experience Group

Less than 5 Mars

5 - 7 Uranus

8 - 10 Pluto

Above 10 Neptune

Draw a flowchart for the problem above. [9 marks]

5|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

5. (a) A 6% sales tax is added to any book purchased at Hasanah Bookstore. Prepare

pseudocode to calculate and display the price that a customer has to pay and the change he

will receive from the transaction. [7 marks]

(b) Prepare pseudocode to print the power of 7 for any number entered by user [2 marks]
6|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

6. (a) Convert pseudocode to flowchart
Start
input regularHours, overtimeHours
baseRate= 2.1
overtimeRate=3.2
regularWages=baseRate*regularHours
overtimeWages=overtimeRate*overtimeHours
totalWages=regularWages +overtimeWages
print totalWages
End

[6 marks]

(b) State output based on this data [1 marks]
regularHours=17 7|Page
overtimeHours=10

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

7. Create an algorithm that print first 50 positive even numbers and displays them in the reverse

of the order.

a) Create pseudocode for the problem above. [7 marks]

b) Create flowchart for the problem above. [5 marks]

8|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020

8. Create a program that calculates the average of a few students’ weight. The value -1 for weight
indicates the end of input. The program will also be able to determine and display the maximum
weight and his/her name and the minimum weight and his/her name. Please use these variable
names: MaxWeight, MinWeight, MaxName, MinName

a) Create a pseudocode of the problem above. [7 marks]

9|Page

KOLEJ MATRIKULASI KEDAH PRE PSPM SESSION 2019/2020
[9 marks]
b) Create flowchart for the problem above.
E

END OF QUESTION PAPER

10 | P a g e


Click to View FlipBook Version