Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module ClinicDiagnosis
- ' Global variable to track the total cost
- Dim totalCost As Integer = 0
- Function ConductTest1() As Boolean
- totalCost += 100 ' Add cost for the test
- Console.WriteLine("Conducting Test 1...")
- ' Assume this test returns a negative result
- Return False
- End Function
- Function ConductTest2() As Boolean
- totalCost += 100 ' Add cost for the test
- Console.WriteLine("Conducting Test 2...")
- ' Assume this test returns a positive result
- Return True
- End Function
- Function ConductTest3() As Boolean
- totalCost += 100 ' Add cost for the test
- Console.WriteLine("Conducting Test 3...")
- ' Assume this test would return a negative result
- Return False
- End Function
- Sub CheckForDiagnosis()
- ' Using short-circuiting with OrElse
- If ConductTest1() Or ConductTest2() Or ConductTest3() Then
- Console.WriteLine("Diagnosis identified.")
- Else
- Console.WriteLine("No issues detected in all tests.")
- End If
- ' Display total cost
- Console.WriteLine($"Total cost of tests: ${totalCost}")
- End Sub
- Sub Main()
- ' Initiate the test process
- CheckForDiagnosis()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment