Beruflich Dokumente
Kultur Dokumente
Design an algorithm using flowchart to print the visitors admission charges for Zoo
Negara. The admission charges for Zoo Negara are varies according to the visitors
category. The charges are as follows:
Begin
sum = 0
count = 1
REPEAT
IF count is even THEN
sum = sum + count
count = count + 1
UNTIL count > 20
DISPLAY sum
Start
Sum = 0
Count =1
No
Count = Count + 1
No
Is Count
> 20 ?
Yes
Display Sum
Stop
Convert the following pseudocode into a flowchart
DO
DISPLAY main menu
GET marks
IF marks <40
DISPLAY Fail
ELSE IF marks <50
DISPLAY Pass
ELSE IF marks <80
DISPLAY Credit
ELSE IF marks <=100
DISPLAY Distinction
END IF
ENDDO
Start
DISPLAY
main menu
GET
marks
marks Yes
DISPLAY
< =40
Fail
No
marks Yes
DISPLAY
< =50
Pass
No
marks Yes
DISPLAY
<= 80
Credit
No
marks Yes
DISPLAY
<= 100
Distinction
No
Stop
a) Draw the flowchart using the appropriate symbols and arrows to show the sequence of steps in
finding the profit or loss in the trading of an item.
Start
Is Profit = SP-CP
SP>C
P
Loss=CP=SP
End
a) A weather station receives 15 temperatures expressed in degrees Fahrenheit. Write a
pseudocode that will accept each Fahrenheit temperature, convert it to Celsius and
display the converted temperature to the screen. After 15 temperatures have been
processed, the words All temperatures processed are to be displayed on the screen.
c_temp = (f_temp 32) * 5/9
Fahrenheit_Celsius_conversion
Set temperature_count to zero
DOWHILE temperature_count < 15
Prompt operator for f_temp
Get f_temp
compute c_temp = (f_temp 32) * 5/9
Display c_temp
add 1 to temperature_count
ENDDO
Display All temperatures processed to the screen
END