50 likes | 202 Views
פתרון בוחן הכיתה. שאלה #1. Module Module1 Sub Main() Dim x, z As Integer x = Console.ReadLine() z = Console.ReadLine() If (x = 0) Then Console.WriteLine("Error") Else
E N D
שאלה #1 Module Module1 Sub Main() Dim x, z As Integer x = Console.ReadLine() z = Console.ReadLine() If (x = 0) Then Console.WriteLine("Error") Else Console.WriteLine("Y is " & (40 * x * x * x - 4 * z * z) / (2 * x)) End If End Sub End Module
שאלה #2 Module Module1 Sub Main() Dim count As Integer = 0 Dim temp, i As Integer For i = 1 To 1000 temp = Console.ReadLine() If (temp Mod 10 = 0) Then count += 1 End If Next Console.WriteLine("There were " & count & " times ") End Sub End Module
שאלה #3 Module Module1 Sub Main() Dim i, j, width, height As Integer Console.WriteLine("Please enter height") height = Console.ReadLine() Console.WriteLine("Please enter width") width = Console.ReadLine() For i = 1 To height For j = 1 To width Console.Write("*") Next Console.WriteLine() Next End Sub End Module
שאלה #4 Module Module1 Sub Main() Dim count As Integer = 0 Dim temp As Integer = 1 While (temp > 0) temp = Console.ReadLine() If (temp > 50) Then count += 1 End If If (temp < 50 And temp >= 0) Then count -= 1 End If End While Console.WriteLine("The number is " & count) End Sub End Module