You are on page 1of 3

Pseudocode Practice

Write codes that fulfill the following requirements:

Difficulty Level: Easy


1. Ask the user for a name. After that, OUTPUT “Hello, (the name where the user has typed
in).

2. Create a variable call MEALCOST. Assign a value of 10 to it.


Then, create another variable call MEALSELLINGPRICE, which is twice the value of
MEALCOST.
Then, create another variable call TAX, which is 6% of the MEALSELLINGPRICE.
Lastly, create a variable call TOTALPRICE, which is the sum of MEALSELLINGPRICE and TAX.

---------------------------------- BADGE EARNED!! Current rank: Beginner ---------------------------------

Difficulty Level: Medium


3. DECLARE a dynamic array, named it as Y10CLASS, which will be used to contain a list of
names.

4. Design a program that asks a user to INPUT two numbers. The program will multiply the
numbers together (hint: you need to create a variable that stores the product). If the
product is larger than 100 it outputs the message “Greater than 100”. If not, it does nothing.

--------------------------------- BADGE EARNED!! Current rank: Amatuer --------------------------------

1
Pseudocode Practice

Difficulty Level: Hard


5. Fries are sold in the canteen at $3 each, if 10 fries are bought then the discount is
5%, if 20 fries are bought the discount is 15%. No more than 30 fries can be bought
in a single transaction (hint: A while loop can be used for validation (eg. Fries
number cannot be less than 1 or more than 30).

(Do not use CASE OF, use IF ... ELSE ... THEN instead)

You are asked to design a program that can automatically calculate the cost of the
purchase. Print out the cost. The program will keep repeating until a user INPUT a
value "stop". Write the pseudocode for this program.

------------------------------------ LEVEL UP!! Current rank: Professional -----------------------------------

2
Pseudocode Practice

Standard methods of solution

1. Totaling (FIND ANSWER IN SLIDE PG 113)

StudentMark [1:10]
70 75 80 60 70 65 75 90 95 100

Write the pseudocode to find the total mark:

2. Counting (FIND ANSWER IN SLIDE PG 115)

StudentMark [1:10]
70 75 80 60 70 65 75 90 95 100

Write the pseudocode to find the number of students who pass (mark > 50) the exam.

You might also like