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 inaazlin, 2018-12-11 21:16:01

2.1(c) Design a Solution - Selection

Design a Solution - Selection

Keywords: Selection

Multiple Selection (if-else-if)

• Pseudocode
start

input code
if code = 1

print “Degree in Multimedia”
else if code = 2

print “Degree in Networking”
else if code = 3

print “Degree in Robotics”
endif
end

Multiple Selection (if-else-if)

start • Flowchart

Input code true Print “Degree in
true Multimedia”
code=1 true
false Print “Degree in
Networking”
code=2
false Print “Degree in
Robotics”
code=3

end

Selection: challenge1

Create an IPO analysis , Pseudocode and flowchart

A program that accepts a value for body
temperature that will display a message “You are
sick” if the body temperature is above than 370C
else print a message “Your body temperature is
normal”.

Selection:challenge2

Create an IPO analysis , Pseudocode and flowchart

Malaysia Airlines will impose additional charges for
luggage that is more than 70 kilos. The additional
charge is MYR 1.00. Create a program that will prompt
the user to enter the weight of their luggage. Then
display a message “You have to pay extra MYR 1.00” if
the luggage is more than 70 kilos. Otherwise, display a
message “No extra charges for your luggage. Have a
nice flight.”

Selection : Challenge 3

Create an IPO analysis , Pseudocode and flowchart

Write a pseudo code for a program to solve a
problem If purchase is more than RM50, 30%
discount is given. Otherwise no discount is given.
Calculate and display the amount paid.

Selection : Challenge 4

Create an IPO analysis , Pseudocode and flowchart

1. Find and display the maximum number between
two integer numbers.

Selection : Challenge 5

Create an IPO analysis , Pseudocode and flowchart

1. A program to determine and display whether the
number entered is “even number” or “odd
number”

Selection : Challenge 5

Create an IPO analysis , Pseudocode and flowchart

Sunshine Supermarket parking fee charge RM1 for
first 1 hour and 0.50 cent for the following hours.
Design a pseudocode to compute parking fee has to
pay by a customer.

Create an IPO analysis , Pseudocode and flowchart for…

1. a program that display the message “Excellent” when a
student’s test score is at least 90. Else display a message “Go
and see your lecturer”.

2. A problem If purchase is more than RM3000, the 2.5% tax
imposed on it. otherwise there is no tax imposed. Calculate and
display the amount paid.

3. A program to determine which rectangle is bigger between
two rectangles. Assume you need to enter value of length and
width for both rectangles.

4. Write a pseudocode and flowchart to determine and
display grade based on the following table:

Mark Grade

80-100 A
65-79 B
40-64 C
0-39 F

5. A courier company, Gofast wants to determine
payable sum of their mileage claims. The payable
sum is calculated by using this table:

KM Cents per KM
First 500 50
Next 200 40
Each extra KM 30

Prepare IPO analysis , Pseudocode and
FLowchart


Click to View FlipBook Version