Sunday, October 23, 2016

1. Programming practice for 9608 ( paper 2 )

Computer Science(9608) notes and Resources










Module Module1

    Sub Main()
        Dim BikeID As String
        Dim numPart As Integer
        Dim flag As Boolean = False
        Console.WriteLine("Enter Bike ID: ")
        BikeID = Console.ReadLine()
        If Len(BikeID) = 6 Then
            If Mid(BikeID, 1, 4) = "BIKE" Then
                numPart = Val(Mid(BikeID, 5, 2))
                If numPart > 0 And numPart <= 99 Then
                    flag = True
                End If
            End If
        End If
        If flag = True Then
            Console.WriteLine("Valid")
        Else
            Console.WriteLine("Invalid")
        End If
        Console.ReadLine()
    End Sub


End Module


                                     - CIE A-LEVEL COMPUTER SCIENCE (  9608 )

No comments:

Post a Comment

Comments here....