Vous êtes sur la page 1sur 2

CSC118 | FUNDAMENTALS OF ALGORITHM DESIGN

ASSIGNMENT [WWW]: GROUP ASSIGNMENT

Question 1

Food Active Sdn. Bhd is a snack wholesaler in Johor. The management wants to develop a
simple program to help distributors to calculate the wholesale price. Refer to the table below for
further details.

Product code Quantity Wholesale price Minimum Order


(RM)
10 – 50 pcs 2.0
AA 51 – 100 pcs 1.5 10
More than 100 pcs 1.0
20 – 50 pcs 5.0
BB 20
More than 50 pcs 4.0

Note: an additional 6% for Government Service Tax (GST) will be charged.

Write a pseudocode that will be repeated until the user enter ‘N’ to stop. The pseudocode will
perform the following task:

 Prompt the user to enter the product code and quantity. Display an error message if the
user entered an invalid code or if the quantity fails to meet the minimum number of
orders.
 Repeat the process until the user wants to stop purchasing. Calculate and display the
total of GST and total price after GST.

Prepared by Nor Hafizah Abdul Razak


CSC118 | FUNDAMENTALS OF ALGORITHM DESIGN
ASSIGNMENT [WWW]: GROUP ASSIGNMENT

Question 2

Good Health is an accredited and leading hospital that offers the best one-stop healthcare and
management centre. Good health is an efficient healthcare provider that gives total solutions
from every health aspect. The table below shows the details of the health screening packages
offered by this centre for this month:

Health screening Gender Age Price (RM) Discount (%)


package
Men All ages 450
Less than or 500
Basic 5
Women equal to 40
More than 40 650
Men 950
Complete All ages 10
Women 1100

Write a pseudocode will perform the following tasks and it will be executed until the user request
to stop:

 Prompt the user to enter health screening package, gender, and age. Display an error
message “invalid health screening package if the user enter invalid health screening
package.
 Calculate the net price that each patient has to pay (Net price is the original price minus
discount).
 Count and display the number of customer for each health screening package.
 Calculate and display the total price for each health screening package.
 Calculate and display the grand total for the entire health screening packages.

Prepared by Nor Hafizah Abdul Razak