Advertisement
Guest User

Untitled

a guest
Dec 8th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module Module1
  2.  
  3.     Function Obliczenia(x1 As Integer, x2 As Integer, x3 As Double) As Double
  4.         Dim result As Double
  5.  
  6.         If x3 > 5 Then
  7.             result = (x1 - x2) / x3
  8.         ElseIf x3 <= 5 Then
  9.             result = (x1 - x2) * x3
  10.         End If
  11.  
  12.         Obliczenia = result
  13.     End Function
  14.  
  15.     Sub Main()
  16.         Dim x1 As Integer
  17.         Dim x2 As Integer
  18.         Dim x3 As Double
  19.         Dim result As Double
  20.         System.Console.WriteLine("Podaj x1: ")
  21.         x1 = System.Console.ReadLine()
  22.         System.Console.WriteLine("Podaj x2: ")
  23.         x2 = System.Console.ReadLine()
  24.         System.Console.WriteLine("Podaj x3: ")
  25.         x3 = System.Console.ReadLine()
  26.         result = Obliczenia(x1, x2, x3)
  27.         System.Console.Write("Wynik: ")
  28.         System.Console.WriteLine(result)
  29.         System.Console.ReadKey()
  30.     End Sub
  31.  
  32. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement