I need to create a program which calculates the bonus points for the books read.
This program need to obtain reader name and bonus point earned.
Number of books read Points is as bellow;
First three books 10 points each
Next three books 15 points each
All books over six 20 points each
I have created an interface like attached in doc file "Reading Program.doc".
I have created the code to calculate the bonus point, refer interface "Form2", when the calculate button is clicked, below is the source code creted:
Public Function calcPoints(Booksread As Integer) As Integer Dim Points As Integer Dim Booksremaining As Integer Points = 0 Booksremaining = Booksread If Booksremaining > 0 Then Points = Min(Booksremaining, 3) * 10 Booksremaining = Booksremaining - 3 End If If Booksremaining > 0 Then Points = Points + Min(Booksremaining, 3) * 15 Booksremaining = Booksremaining - 3 End If If Booksremaining > 0 Then Points = Points + Booksremaining * 20 Booksremaining = 0 End If calcPoints = Points End Function Private Sub calculate_Click() Dim Points As Integer Text2.Text = Points End Sub
This source code does not seems to be working as it returning zero bonus points when i click the calculate button.
Can anyone help me on this as soon!
Edited 5 Years Ago by Nick Evan: Added CODE tags