5.
Consider the following formula: N= X*X/(1-X). The formula is used to calculate N.
The calculation is repeated until a sentinel of X=0 is entered. Create a program that will
show the repeated calculation using pseudocode. The program should receive the
value of X. An error message should be display if 1 is entered as a value of X. The
program should then print the value of X and N. [6 marks]
6.
Convert the following pseudocode into a follow chart:
START
Prompt the user for the house value
Get houseValue
[12 Marks]
Prompt the user for the amountOfWaterUsed
Get amountOfWaterUsed
monthlyAmount=0
IF {house Value> 500 000} THEN
monthlyAmount= (amountOfwaterUsed*20} +{0.05*houseValue)
ELSEIF (houseValue > 300 000} AND {houseValue <500 000} THEN
monthlyAmount= (amountOfwaterUsed*20} +{0.03*houseValue)
ELSE
monthlyAmount= (amountOfwaterUsed*20}
END IF
END IF
Display monthlyAmount
END
7.
Create a program using pseudocodes which takes a temperature input over a 100-
day period (once per day) and display the number of days when the temperature was
below 20C and the number of days when the temperature was 20C and above.
[10 marks]
8. Write a program using pseudocodes algorithm that would enable the user to enter student
marks for 100 students. The program should then determine whether the mark entered is a
pass or fail given that the pass mark is 50. [8 Marks]
************ Endof the Paper***************
s