Professional Documents
Culture Documents
Zaec Marking Scheme P3
Zaec Marking Scheme P3
MARKING SCHEME
©ZAEC J2018
Question 1 a
Sub Main()
Dim l, w, A, P As Single
WriteLine("Enter the length the rectangle and press Enter")
l = CSng(ReadLine())
WriteLine("Enter the Width the rectangle and press Enter")
w = CSng(ReadLine())
P = (l + w) * 2
A = l * w
WriteLine("The area of the rectangle is {0} and the Perimeter is {1}", A, P)
ReadKey()
End Sub
End Module
3 marks for Code - 1 mark for capturing, 2 marks calculation and 1 mark for display
P = (l + w) * 2
A = l * w
MessageBox.Show("The area of the rectangle is " & A & " and the Perimeter is "
& P)
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
End
End Sub
End Class
Accept any other variations as long as they produce the same results.
Sub Main()
Dim num, fact, i, sum, temp, r As Integer
WriteLine("Enter any positive whole number and press Enter")
num = CInt(ReadLine())
temp = num
sum = 0
While temp > 0
fact = 1
r = temp Mod 10
For i = 1 To r
fact *= i
Next i
sum += fact
temp \= 10
End While
If num = sum Then
WriteLine("{0} is a strong number", num)
Else
WriteLine("{0} is not a strong number", num)
End If
ReadKey()
End Sub
End Module
3 marks for declarations
2 marks for initialisation
2 marks for outer loop
2 marks for digit and remaining number calculation
2 marks for factorial calculation
2 marks for decision making
Code
Public Class frmQuestion1b
Other variations are also considered as long as they come up with a strong number
3 marks if the combobox has the animals displayed as above. 2 marks for combobox with no
animals displayed
Code
Public Class frmQuestion2a
Accept other variations which include the stated marking points above.
Question 3a.
Output
Code
Imports System.Console
Module Question3a
Sub Main()
Dim num, totmarks As Integer
Dim ave As Integer
WriteLine("Enter the total number of learners")
num = CInt(ReadLine())
totmarks = getMarks(num)
ave = calculateAverage(totmarks, num)
WriteLine("The sum of the entered marks is {0} and the average mark is
{1}", totmarks, ave)
ReadKey()
End Sub
Function getMarks(a As Integer) As Integer
Dim mark, sum As Integer
sum = 0
Question 3b
Output
Accept other variations as long they will be yielding the same results.
No Console app on this question
Question 4a
Question 4c Prod_ID
Question 4d
Question 4e
Question 5 a
Heading - 3 marks
1 mark for bold
1 mark for underline
1 mark for center alignment
Text – 1 mark
Links – 6 marks – 2 marks each
Question 5c