0% found this document useful (0 votes)
265 views

Latihan Pseudocode&flowchart

The document provides examples of pseudocode and flowcharts for various algorithms: 1. An algorithm that reads 3 numbers and prints the largest number. 2. An algorithm that reads an employee's name, overtime hours, absent hours and determines their bonus payment based on a bonus schedule. 3. An algorithm that calculates values for P and Q based on whether P is positive or negative. 4. A flowchart that displays whether a number input is odd or even.

Uploaded by

Nurlaila RMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views

Latihan Pseudocode&flowchart

The document provides examples of pseudocode and flowcharts for various algorithms: 1. An algorithm that reads 3 numbers and prints the largest number. 2. An algorithm that reads an employee's name, overtime hours, absent hours and determines their bonus payment based on a bonus schedule. 3. An algorithm that calculates values for P and Q based on whether P is positive or negative. 4. A flowchart that displays whether a number input is odd or even.

Uploaded by

Nurlaila RMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Example 6

Write an algorithm that reads three numbers and prints the value of the largest number.
Pseudocode:
Step 1: Input N1, N2, N3
Step 2: if (N1>N2)
then if (N1>N3)
then MAX ← N1 [N1>N2, N1>N3]
else MAX ← N3 [N3>N1>N2] endif else if (N2>N3)
then MAX ← N2 [N2>N1, N2>N3]
else MAX ← N3 [N3>N2>N1]
endif endif Step 3: Print “The largest number is”, MAX
Flowchart:

Example 7

Write and pseudo code and draw a flowchart to a) read an employee name (NAME), overtime hours
worked (OVERTIME), hours absent (ABSENT) and b) determine the bonus payment (PAYMENT).

Bonus Schedule
OVERTIME – (2/3)*ABSENT Bonus Paid
>40 hours $50
>30 but ≤ 40 hours $40
>20 but ≤ 30 hours $30
>10 but ≤ 20 hours $20
≤ 10 $10
Flowchart

Example 8

Dalam suatu perhitungan nilai P=X+Y. Jika P positif, maka Q=X*Y, sedangkan jika negatif maka nilai
Q=X/Y. Buatlah flowchart untuk mencari nilai P dan Q!
Example 9

Buatlah Flowchart untuk menampilkan bilangan ganjil dan genap, dengan inputannya adalah
bilangan yang akan dicek !

You might also like