The program will allow the teacher to:
Store the names and marks of the pupils
Calculate Percentages
Produce a list of pupils showing their marks and percentages.
Show the highest achieving pupil in the class.
Show the lowest achieving pupil in the class.
Display whether a pupil has sat their NAB.
Main Algorithm
1. Start Loop.
2. Enter Names and Marks.
3. Calculate Percentage.
4. End loop
5. Display pupils name and percentages.
6. Display the highest mark in the class.
7. Display the lowest mark in the class.
8. Show any resits required.
I am struggling with steps 6 and 7 the others i think i have done fully. Also the maximum entries allowed is 10, how can i limit this???Code:Private Sub cmdLow_Click() Dim High_Score As Integer High_Score = score(0) For Counter = 1 To (no_scores - 1) If score(Counter) > High_Score Then High_Score = score(Counter) End If Next Counter Form1.Print High_Score End Sub Private Sub cmdLow_Click() Dim Low_Score As Integer Low_Score = score(0) For Counter = 1 To (no_scores - 1) If score(Counter) > Low_Score Then Low_Score = score(Counter) End If Next Counter Form1.Print Low_Score End Sub Private Sub cmdQuit_Click() Unload Me End Sub Private Sub cmdStart_Click() Dim Pupil_Name As String Dim Mark As Integer Dim Percentage As Integer Pupil_Name = InputBox("Enter name of pupil") Mark = InputBox("Enter their mark") While Mark < 0 Or Mark > 20 MsgBox ("Invalid Mark. Try Again") Mark = InputBox("Enter their mark") Wend Percentage = Mark / 20 * 100 lstNames.AddItem Pupil_Name lstMarks.AddItem Mark lstPercentage.AddItem Percentage & "%" If Percentage < 60 Then lstResit.AddItem Pupil_Name End If End Sub Private Sub Label1_Click() End Sub
Thanks 4 Help




Reply With Quote