Professional Documents
Culture Documents
UTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 1
a. Input
b. Process
c. Output
1 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 2
Identify input, process, and output for the following problem statements;
2. Ahmad wants to create a program that determines the total area of a piece of land
where length and width are given.
4. Convert a measurement in millimetre (mm) to meter (m) and print the result.
5. A government tax of 6% and service tax of 10% will be added to the price of a set
of meal bought at McK. Calculate the total price that Abu has to pay for a set of
meal.
9. Calculate and display the overtime pay received by an employee. Overtime rate is
RM5 per hour.
10. Calculate and print the sum, average, and multiplication of two given numbers.
11. A Computer Science lecturer want to determine the final mark for every student.
The final marks are taken from average mark of three quizzes and total from two
tests. Print the final mark for a student.
12. A computer factory worker is paid based in total working hours RM8.25 per hour.
12% of the total salary will be deducted for taxes. Prepare the monthly net salary
for the worker.
2 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 3
3. Create a program that will accept student’s name and age. If the student’s age is
below 40, the program will print a message “You are eligible to take a Degree
programme”.
4. Print the message “You’re entitle to vote” for a person whose age is above 20.
5. Display a message “You are an excellent student” for a student whose cumulative
grade point average (CGPA) is 3.75 or above.
8. This program prompts the user to enter a number. If the number is greater than
zero, positive number status is display. Otherwise, negative number was entered.
9. Calculate area of circle when radius is greater than or equal 0.0 and display it as
output. If not, display “Radius can’t be a negative number”.
3 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
10. Customer who wants to rent a car will be charges RM65 if total hour less or equal to
24 hours. An extra RM6 will be charged for any additional hour. Calculate and display
total charge of car rental.
11. A customer wants to rent a car will be charged RM80 if total hours are less or equal
to 24. An extra RM5 will be charged for additional hour. Calculate and display total
charge for car rental.
12. Assume that the user has been prompted for the ages of two people with the answer
stored in variables named age1 and age2. Display “The first person is older” when
age1 is greater than age2. Display “The second person is older” when age1 is less
than age2. If age1 and age2 is same value, display “Both person is same age”.
13. Computes and print the product or total of three numbers based on the user request.
If user request is 1, the program will count the product of three numbers. If user
request is 2, the program will count the total of three numbers. Otherwise, display
“Wrong choice”.
4 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 4
3. Briefly describe three (3) basic process involve in counter controlled repetition.
Analyse the problem below, write the problem analysis for each of the problems.
15. Find the average marks for 6 tests that have been taken by a student.
16. Calculate and print the average of three tests for 30 students.
5 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 5
1 a. Define algorithm.
Graphic
Name Description
Symbol
5. Give one reason why flow chart is more popular in representing algorithm.
6 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 6
Prepare a problem analysis and pseudo code for the following problems .
2. A car travels from station A to station B. Calculate the distance from station A to
station B. (distance = speed x time)
6. Given the Splash Water Park entrance ticket rates as shown below:
Ticket price for adult : RM 13.50
Ticket price for children : RM 7.90
Create a program that allows a user to key in the number of family members based
on the criteria above, and then calculate the total ticket price for a family.
7. Prime College offers two courses; Robotic course and Networking course. The
current fee for the Robotic course is RM55 per month and for the Networking is
RM105 per month. Students can register for only one of the course or for both
courses. Help the manager to calculate the total fees paid by all students for each
course, and then calculate the total fees for both courses.
8. Madam Nur takes a car loan at a bank. The interest rate fixed by the bank is 4%
per year, which means she has to pay the interest of 4% of the loan every year.
She is allowed to pay the total of her loan plus the interest by monthly instalment.
Calculate the total amount that she has to pay to the bank and the monthly
payment that she has to pay.
7 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
11 32.10
22 75.30
33 24.60
When a customer makes an order for a product, he/she is required to provide its
product code as well as the quantity. Write an algorithm which input the code and
quantity of one product to be purchased and then output the amount to be paid
for that purchase.
10. Ah Lim plans to install floor tiles for his guest area spaces which are rectangular
in shape. The price per square feet of floor tiles will be determined after Lim
chooses the suitable tiles. Calculate and display the area of Lim’s guest area space
and the total cost of tiles needed to be paid by him.
8 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 7
2. A car travels from station A to station B. Calculate the distance from station A
to station B. (distance = speed x time)
6. Given the Splash Water Park entrance ticket rates as shown below:
Ticket price for adult : RM 13.50
Ticket price for children : RM 7.90
Create a program that allows a user to key in the number of family members
based on the criteria above, and then calculate the total ticket price for a family.
7. Prime College offers two courses; Robotic course and Networking course. The
current fee for the Robotic course is RM55 per month and for the Networking is
RM105 per month. Students can register for only one of the course or for both
courses. Help the manager to calculate the total fees paid by all students for
each course, and then calculate the total fees for both courses.
8. Madam Nur takes a car loan at a bank. The interest rate fixed by the bank is 4%
per year, which means she has to pay the interest of 4% of the loan every year.
She is allowed to pay the total of her loan plus the interest by monthly instalment.
Calculate the total amount that she has to pay to the bank and the monthly
payment that she has to pay.
9 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
11 32.10
22 75.30
33 24.60
When a customer makes an order for a product, he/she is required to provide its
product code as well as the quantity. Write an algorithm which input the code
and quantity of one product to be purchased and then output the amount to be
paid for that purchase.
10. Ah Lim plans to install floor tiles for his guest area spaces which are rectangular
in shape. The price per square feet of floor tiles will be determined after Lim
chooses the suitable tiles. Calculate and display the area of Lim’s guest area
space and the total cost of tiles needed to be paid by him.
10 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 8
Prepare a problem analysis and pseudo code to solve the following problems.
1. Display “The number you entered is 1” when user enter number 1, otherwise
terminates the process.
3. Print “Qualified” when user enters mark more and equal to 70, else print “Disqualified”.
4. If a student is in Module 2 group, display the message “The student is taking Computer
Science subject”. Otherwise, display the message “The student is taking Biology
subject”.
5. Determine whether a number entered by a user is an even or odd number. (Hint: use
modulus operator %)
6. MyPC magazine is sold at RM5 each if at least 5 units of the magazine are purchased,
and it is sold at the price of RM7 each otherwise. Calculate the price a customer has
to pay after he enters the quantity of the magazines that he purchased.
7. A program will ask user to enter age for two peoples, where the values entered will be
stored in variables age1 and age2. Display “The first person is older” when age1 is
greater than age2, else display “The second person is older”.
8. Calculate BMI when a user enters weight and height. Print “Please reduce your weight”
if BMI is greater and equal to 25.0. If not, print “You have an ideal weight”.
11 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 9
Prepare a problem analysis and pseudo code to solve the following problems.
2. Create a program that will ask a user to enter age for two people. Display “The first
person is older” when age1 is greater than age2, else display “The second person is
older”. If both are not true, display “Both person is same age”.
3. This program prompts a user to key in a number as a choice for his/her favourite
holiday destination. If the choice is 1, it will display “Pulau Langkawi”. If the choice is
equal to 2, it will display “Cameron Highland”. If the choice is 3, it will display “Genting
Highland”, and it will display “Bukit Merah” if the choice is equal to 4. Otherwise, a
message “Your choice is not in the list” will be displayed.
4. If the temperature is 80 degrees or greater and the humidity is greater than 60%,
most people find it uncomfortably warm. If the temperature is greater than 80 degrees
and the humidity is 60% or less, most people find it warm but comfortable.
Temperatures below 80, regardless of humidity, are comfortable. Create an algorithm
that represents this situation
5. Calculate electric bill based on the electricity usage in watt as given below:
6. An allowance for a part time lecturer will be paid monthly based on the total lecture
hours per month. Payment rate is as follows:
12 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
7. Calculate Body Mass Index when user enter weight (in kg) and height (in meter).
From the BMI result, the system will display a message as in the table below.
25-29.9 Overweight
Above 30 Obese
8. Enter code of gender and age. Next determine and print appropriate message based
on criteria given below. If gender entered is not in list, the program will display “Invalid
gender”.
13 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 10
1. Display “The number you entered is 1” when user enter number 1, otherwise
terminates the process.
3. Print “Qualified” when user enters mark more and equal to 70, else print
“Disqualified”.
6. MyPC magazine is sold at RM5 each if at least 5 units of the magazine are
purchased, and it is sold at the price of RM7 each otherwise. Calculate the price a
customer has to pay after he enters the quantity of the magazines that he
purchased.
7. A program will ask user to enter age for two peoples, where the values entered will
be stored in variables age1 and age2. Display “The first person is older” when age1
is greater than age2, else display “The second person is older”.
8. Calculate BMI when a user enters weight and height. Print “Please reduce your
weight” if BMI is greater and equal to 25.0. If not, print “You have an ideal weight”.
14 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 11
2. Create a program that will ask a user to enter age for two people. Display “The first
person is older” when age1 is greater than age2, else display “The second person
is older”. If both are not true, display “Both person is same age”.
3. This program prompts a user to key in a number as a choice for his/her favourite
holiday destination. If the choice is 1, it will display “Pulau Langkawi”. If the choice
is equal to 2, it will display “Cameron Highland”. If the choice is 3, it will display
“Genting Highland”, and it will display “Bukit Merah” if the choice is equal to 4.
Otherwise, a message “Your choice is not in the list” will be displayed.
4. If the temperature is 80 degrees or greater and the humidity is greater than 60%,
most people find it uncomfortably warm. If the temperature is greater than 80
degrees and the humidity is 60% or less, most people find it warm but comfortable.
Temperatures below 80, regardless of humidity, are comfortable. Create an
algorithm that represents this situation
5. Calculate electric bill based on the electricity usage in watt as given below:
6. An allowance for a part time lecturer will be paid monthly based on the total lecture
hours per month. Payment rate is as follows:
First 12 hours - RM 100 per hour
Additional hours - RM 50 per hour
Calculate the monthly allowance for a part time lecturer.
15 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
7. Calculate Body Mass Index when user enter weight (in kg) and height (in meter).
From the BMI result, the system will display a message as in the table below.
25-29.9 Overweight
Above 30 Obese
8. Enter code of gender and age. Next determine and print appropriate message based
on criteria given below. If gender entered is not in list, the program will display
“Invalid gender”.
16 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 12
Prepare a problem analysis and pseudo code to solve the following problems.
3. Write a program that print the first 16 even numbers in descending order.
6. Display the odd integers and its total starting from 23 to 12.
17 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 13
Prepare a problem analysis and pseudo code to solve the following problems.
4. Prompts user to enter 15 numbers. In the end, the program will determine and
display which number is the
a. Highest
b. Lowest
5. Given a number of person involved in BMI Health Campaign (first input). All of them
are required to enter weight and height. Calculate the BMI for each person and find
the average.
6. Prompt the user to input five numbers. The program will check and display whether
each number is the:
a. Negative and Even
b. Negative and Odd
18 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 14
3. Write a program that print the first 16 even numbers in descending order.
6. Display the odd integers and its total starting from 23 to 12.
19 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 15
3. Prompts user to enter 15 numbers. In the end, the program will determine and
display which number is the
a. Highest
b. Lowest
4. Given a number of person involved in BMI Health Campaign (first input). All of them
are required to enter weight and height. Calculate the BMI for each person and find
the average.
5. Prompt the user to input five numbers. The program will check and display whether
each number is the:
a. Negative and Even
b. Negative and Odd
20 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 16
Analyse the problem below, then determines the IPO and create pseudo code for each of
the problems.
1. Design an algorithm for a program that will accepts a list of product price from user
and calculate the total price. The process will continue until the user enters value -1.
2. A program will calculate the average for a few integers entered by user. The user
should key in 0 to terminate the sequence.
3. Design an algorithm to calculate the total temperature for a list of daily temperatures
that will be entered by user. The calculation will stop when the value of temperature
entered is -999.
4. A program which repeatedly prompts the user for an integer. If the integer is even,
print the integer. If the integer is odd, don’t print anything. Exit the program if the
user enters the integer 99.
5. A program read characters from the keyboard until a blank is read. Use sentinel
controlled while loop to find the number nonblank characters read from the keyboard.
Display the number found.
21 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 17
Analyse the problem below, create flowchart for each of the problems.
1. Design an algorithm for a program that will accepts a list of product price from
user and calculate the total price. The process will continue until the user enters
value -1.
2. A program will calculate the average for a few integers entered by user. The user
should key in 0 to terminate the sequence.
4. A program read characters from the keyboard until a blank is read. Use sentinel
controlled while loop to find the number nonblank characters read from the
keyboard. Display the number found
5. A program will accept a series of numbers from user and determine whether
each number entered is an even or odd number. The program will stop when a
user enters 0.
22 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
TUTORIAL 3 hours
PLO PLO 1: Acquire knowledge of science and mathematics fundamentals to higher level education.
TUTORIAL 18
1. Tangkak Jaya Shopping Complex charges RM4.00 per hour to park for the first 3
hours. For the next two hours, the charge is RM3.00 per hour, and RM2.50 per
hour for the next two hours. A flat rate of RM25.00 is charged if the car parks
more than 7 hours. Determine the IPO and draw the pseudo code and flowchart
to calculate the total parking fees.
2. Ledang Telco Company charge its customer RM50.00 per month as a fee with
100 free calls. For additional calls after 100 free calls, the customer will be
charged based on the following table.
100 RM 0.60
Analyse the IPO and pseudocode, then draw a flow chart that input total number
of calls, then calculates and display the total charged.
3. Mr Luna owns a car dealership with 7 salespersons. Identify the input, process
and output and create flow chart and pseudo code to determine the staff of the
month based on highest sale amount achieved. The problem reads the sales
amount each sales person, then display the highest sales amount.
4. User enter 55 number. Determine how many odd number and even number
entered by user. Then calculate average for odd numbers.
23 | Page
Tutorial| Semester 2 |Session 2020/2021 DC024 | COMPUTER SCIENCE
(30 days). Write the IPO, pseudo code and flow chart to prompt user to input
these data. Then, calculate and display the total and average temperature
entered by user for a month. Also display the lowest value of the temperature
for a month.
24 | Page