100% found this document useful (1 vote)
61 views15 pages

Algorithm

Uploaded by

ethmens
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
100% found this document useful (1 vote)
61 views15 pages

Algorithm

Uploaded by

ethmens
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 15

WRITE A PROGRAMME USING

FLOWCHART AND PSEUDOCODE


ALGORITHM THAT INCLUDES SEQUENCE,
SELECTION AND ITERATION CHOICES IN
PROBLEM-SOLVING

SAMMY ETHANIEL
DISCUSS AT LEAST THREE WAYS TO
DO PROPER HAND-WASHING AND
PREPARE BEVERAGES WITH OR
WITHOUT SUGAR AND/OR MILK
EXAMPLES OF POSSIBLE ALGORITHMS FOR THE PROPER
HAND WASHING METHODS
1. The CDC Method
Wet your hands with clean running water (warm or cold)
and apply soap.
Lather your hands by rubbing them together with the soap.
Be sure to lather the backs of your hands, between your
fingers, and under your nails.
Scrub your hands for at least 20 seconds. Need a time? Hum
the “Happy Birthday” song from beginning to end twice.
Rinse your hands well under clean, running water.
Dry your hands using a clean towel or air dry them.
2. The WHO Method
Wet your hands with clean running water (warm or cold) and
apply soap.
Rub your hands palm to palm in a circular motion.
Rub the back your left hand with your right palm, interlacing
your fingers.
Repeat with the other hand.
Rub your hands palm to palm with fingers interlaced.
Rub the backs of your fingers against your palms with fingers
interlocked.
Clasp your left thumb with your right hand and rub in a
rotational motion.
2. The WHO Method
Repeat with the other thumb
Rub your fingertips against the palm of your opposite hand.
Rinse your hands well under clean, running water.
Dry your hands using a clean towel or air dry them.
3. The Surgeon’s Scrub
Wet your hands and forearms with warm water.
Apply antimicrobial soap to your hands and forearms and scrub
thoroughly for at least 2-6 minutes.
Clean your fingernails using a nail brush.
Dry your hands and forearms with a clean towel or sterile surgical
towel.
WRITE AN ALGORITHM FOR
EXEMPLAR
POSSIBLE ALGORITHM FOR BEVERAGE PREPARATION WITH OR WITHOUT
SUGAR AND/OR MILK
1. Hot Coffee with Sugar and Milk
Steps:
• Boil water and brew coffee using coffee grounds according to package
instructions.
• Pour the desired amount of milk into a mug.
• Add the desired amount of sugar to the mug.
• Pour hot coffee into the mug and stir well.
• Serve and enjoy.
ICED TEA WITHOUT SUGAR
• Boil water and brew tea bags according to package instructions.
• Allow the tea to cool to room temperature.
• Fill a glass with ice cubes.
• Pour the cooled tea over the ice and stir well.
• Serve and enjoy
• Hot Chocolate with Milk and Sugar.
HOT CHOCOLATE WITH MILK AND SUGAR
1. Heat desired amount of milk in a saucepan over medium heat until hot but
not boiling.
2. Add the desired amount of chocolate powder and sugar to the saucepan.
3. Whisk the mixture until the chocolate and sugar are fully dissolved.
4. Pour the hot chocolate into a mug and serve immediately.
1. Write an algorithm on the proper way of turning on the computer in the
box below
TRANSLATE A FLOWCHART
ALGORITHM TO PSEUDOCODE
FORMAT AND VICE VERSA
WRITE AN ALGORITHM USING FLOWCHART FORMAT
CLASS ACTIVITY
Study the Flowchart and Pseudocode below.
Example 1:
Develop a pseudocode and a flowchart to ask the user to enter the voltage (V)
and Current (I), then calculate and displays the resistance R=V/I.
Pseudocode Flowchart
Start Start
PRINT “Please enter the Voltage”
GET V Please Enter
V and Enter I
PRINT “Please enter the Current”
GET I R = V/I

R = V/I
Print R
PRINT “Resistance =“ (Resistance)

Stop
End
Example 2
The pseudocode and flowchart below are used to read the temperature of
people. When the temperature is less than 320F, it prints “Below Freezing”
else it prints “Above Freezing”
FLOWCHART
PSEUDOCODE Start

Start Read
Read Temperature Temp

If Temp < 32 Temp


< 32?
Print “Below Freezing”
Print “Below Print “Above
Else Freezing” Freezing”

Print “Above Freezing”


End End
Draw a flowchart to show the
pseudocode in the box below
1. Read (marks1, marks2, marks3, marks4)
2. Grade (marks1 + marks2 + marks3 + marks4)/4
3. If (grade < 50) then
Write (“FAIL”)
Else
Write (“PASS”)
Endif
4. Exit
Draw a flowchart to show the
pseudocode in the box below
Start
Input marks = from keyboard
If (marks > 49 )
{
Print pass
}
Else
{
Print fail}
End
Study the flowchart shown below. Write an
appropriate Pseudocode the represent the
flowchart. The flowchart explains an algorithm on
how to calculate the area and perimeter of a circle
based on radius entry.
START

Get r
A=3.14*r*r
C=2*3.14*r
Print A, C

STOP

You might also like