You are on page 1of 6

Group Members: Amelia Llewellyn, Olivia McKenzie

Grade: 12C

1. Given the base and height of a quadrilateral write a program to determine if it is a


square or rectangle and display the correct answer to the user.

Pseudocode
START
DECLARE baseNum, heightNum, area as Real

baseNum = 0.0
height = 0.0
area = 0.0

WRITE “Please enter the base of your quadrilateral in


centimeters.”
READ baseNum

WRITE “Please enter the height of your quadrilateral in


centimeters.”
READ heightNum

IF baseNum = heightNum Then


WRITE “Your quadrilateral is a square.”
ELSE
WRITE “Your quadrilateral is a rectangle.”
END IF

STOP
Flowchart

2. A company gives out bonuses based on the amount of income generated by their sales
representatives per month. Once the income generated is greater than or equal to
$10,000 a bonus of 20% is given. If the income generated is greater than or equal
$8,000 but less than $10,000 a bonus of 15% is given. If the income generated is
greater than or equal to $5,000 but less than $8,000 a bonus of 10% is given. If the
income generated is less than $5,000 then a 3% bonus is given. Read the income
generated and print the bonus. Your program should terminate after all 25 sales
representatives have been processed.

Pseudocode

START
DECLARE incomeAmt, bonus as Real
DECLARE count as Integer
incomeAmt = 0.0
bonus = 0.0
count = 0

WRITE “Please enter the income generated this month.”


READ incomeAmt

WHILE count < 25 Do


IF incomeAmt >= 10000 Then
bonus = incomeAmt * 0.20
ELSE
IF incomeAmt >= 8000 Then
bonus = incomeAmt * 0.15
ELSE
IF incomeAmt >= 5000 Then
bonus = incomeAmt * 0.10
ELSE
IF incomeAmt < 5000 Then
bonus = incomeAmt * 0.03
END IF
END IF
END IF
END IF

WRITE “Your bonus amount based on the amount of income


generated is: “,bonus

count = count + 1
ENDWHILE
STOP

Flowchart
3. Design a program that will prompt for and receive the time expressed in 12 hr format
(eg 11:05 pm) convert it to 24-hour format (eg 23:05) and display the new time to the
screen. Your program terminates when -1 is encountered, use the repeat until loop.

Pseudocode

START
DECLARE timeDigi, timeSolider as REAL
DECLARE dayNight as String
DECLARE count as integers

timeDigi = 0.0
timeSolider = 0.0

WRITE “Please specify if you are entering a time in ‘am’ or ‘pm’.”


READ dayNight

WHILE dayNight != -1 DO
IF dayNight = “am” Then
WRITE “Please enter your time in 12 hr format (eg. 11.00).”
READ timeDigi

WRITE “Your time in 24 hr format is “, timeDigi


ELSE
IF dayNight = “pm” Then
WRITE “Please enter your time in 12 hr format (eg. 11.00).”
READ timeDigi

timeSolider = timeDigi + 12.00


WRITE “Your time in 24 hr format is “, timeSolider
END IF
END IF
WRITE “Please specify if you are entering a time in ‘am’ or ‘pm’.”
READ dayNight

END WHILE
STOP
Flowchart

You might also like