Start
Display “Please input hours tutored”
Read hours_tutored
IF hours_tutored >= 3
SET discount  ((Cost_per_hour * hours_tutored * discount_percent)
SET Final_Price  ((Cost_per_hour * hours_tutored) – discount)
ELSE
SET Final_Price = Cost_per_hour
For Loop
While loop
Repeat until
Bounded iteration
We know how many times to repeat the loop e.g For Loop
Unbounded iteration
We don’t know in advance how many times to repeat the loop
While Loop, Repeat Until
Start
Print (‘Enter Student’s score’)
IF score 1 < score 2
SET score 1 = lowest
Header: Weather_app
Declaration: This algorithm will read and evaluate weather conditions
Variables:
weather: String (input)
START
  DECLARE weather AS STRING
  PRINT "Enter the weather (sunny/rainy/cloudy):"
  READ weather
  IF weather IS EQUAL TO "sunny" THEN
      PRINT "Good Day for the beach"
  ELSE
      PRINT "Not a good day for the beach"
  END IF
END
Header: Tree_Auction
Declaration: This algorithm will calculate the adjusted auction price based on
a threshold
Variables:
auction_price: Float (input)
adjusted_price: Float (output)
START
  DECLARE auction_price AS FLOAT
  DECLARE adjusted_price AS FLOAT
  PRINT "Enter the auction price of the Christmas tree:"
  READ auction_price
  IF auction_price > 10000 THEN
      adjusted_price = auction_price - 2000
  ELSE
      adjusted_price = auction_price + 3500
  END IF
  PRINT "The adjusted auction price is: ", adjusted_price
END
Header: Christmas_gifts
Declaration: This algorithm will accept and modify gift count based on
Christmas gifts requested
Variables:
gift_count: Integer (input)
adjusted_gifts: Integer (output)
START
  DECLARE gift_count AS INTEGER
  DECLARE adjusted_gifts AS INTEGER
  PRINT "Enter the number of gifts you want for Christmas:"
  READ gift_count
  IF gift_count <= 5 THEN
      adjusted_gifts = gift_count * 2
  ELSE
      adjusted_gifts = gift_count + 2
  END IF
  PRINT "The adjusted number of gifts is: ", adjusted_gifts
END
Start
Print (‘Enter student score’)
Read student_score
Set