Bakerdude
New member
- Joined
- Nov 14, 2006
- Messages
- 1
- Programming Experience
- Beginner
#############################
############EDIT##############
#############################
*Within the five minuets that I posted this thread I managed to figure it out, start with >=80 then >= 60 then >=40 and it works*
#############################
############EDIT##############
#############################
Hi
I've been given a small assignment to do for college. What I have to do is create a programme that reads a user number input and then gives a result relavent to that input. We were told to create a programme that would tell a user if they passed a course depending on their grade. For example if the user enetered 1 the programme would tell them they failed, if they enter 40 upwards it would tell them they got a PASS grade, if they enter 60 upwards it would tell them they got a MERIT grade and 80 upwards it would return DISTINCTION GRADE.
I got the programme to work if the user enters a number less then 40, it returns the right response. If the user eneters anything more then 40 it also leaves the right response. However when you try to enter anything above 60 the programme gives a response as if you entered something above 40 and not the desired response if you enter 60+
Here is my code.
VB.NET:
Imports System.Console
Public Class Marks
Shared Sub Main()
Dim Result As Decimal
Writeline(" *~*Did you pass your course?*~*")
Writeline("*This prgramme will work it out for you*")
Writeline(" ")
Writeline("Please enter your final score: ")
Result = Readline()
If (Result >=40)
Writeline("Congratulations you got a PASS grade")
Readline()
ElseIf (Result >=60)
Writeline("Congratulations you got a MERIT grade")
Readline()
ElseIf (Result >=80)
Writeline("Congratulations you got a DISTINCTION grade")'
Readline()
Else
Writeline("Sorry you FAILED")
Readline()
End If
End Sub
End Class
VB.NET:
If (Result >=40 <=59)
Writeline("Congratulations you got a PASS grade")
Readline()
I only have a limited knowledge of VB.Net so I can't think of any other ways.
Thanks for any help in advance.
Last edited: