Module Module1

    Sub Main()
        Console.WriteLine("Enter the amount of money")
        Dim x, a, b As Integer
        x = Console.ReadLine
        Console.WriteLine("Enter the price of cake")
b:

        a = Console.ReadLine
        If a < 1 Then
            Console.WriteLine("the price of a cake must be grater than 1")
            Console.WriteLine("Renter the price of cake")
            GoTo b
        End If
        Console.WriteLine("Enter the price of donuts")
c:

        b = Console.ReadLine
        If b > 1000 Then
            Console.WriteLine("the price of a donuts must be less or equal to 1000")
            Console.WriteLine("Renter the price of donuts")
            GoTo c
        End If
        If a + b > 10000 Then
            Console.WriteLine("The sum of unti price of donuts and cake must be lesser or equal to 10000")
            Console.WriteLine("Renter the price of cake")
            GoTo b
        End If
        Dim tempo As Integer
        tempo = (x - a) Mod b
        Console.WriteLine("result= " & tempo)
        Console.ReadLine()

    End Sub

End Module
