Jumat, 03 Desember 2010

console kalkulator

Imports System.Console
Module Module1
Dim a As Double
Dim b, x
Dim c As Double
Dim y As String
Sub Main()
Write("KALAKULATOR SEDERHANA")
WriteLine()
WriteLine()
WriteLine()
Write("--------------------------")
Write("SILAHKAN ISI")
Write("--------------------------")
WriteLine()
WriteLine()
Write("Bilangan 1        : ")
a = ReadLine()
Write("Operator(x,/,+,-) : ")
b = ReadLine()
Write("Bilangan 2        : ")
c = ReadLine()

If b = "x" Then
x = a * c
ElseIf b = "/" Then
x = a / c
ElseIf b = "+" Then
x = a + c
ElseIf b = "-" Then
x = a - c
Else
WriteLine()
Write("OPERATOR YANG ANDA MASUKAN SALAH!!!")
ReadLine()
Clear()
Call Main()

End If
WriteLine()
Write("Hasilnya adalah   : " & x)
ReadLine()
WriteLine()
Write("Ulangi [y/n]? ")
y = ReadLine()
If y = "y" Then
Clear()
Call Main()
Else
Clear()
WriteLine()
WriteLine()
WriteLine()
Write("!!!TERIMA KASIH TELAH MENGGUNAKAN KALKULATOR INI!!!")
WriteLine()
ReadLine()
End

End If
End Sub

End Module

0 komentar:

Posting Komentar

Silahkan gan komentarnya,,karena komentar anda sangat berarti bagi blog ini...Salam blogger

Jangan lupa kasih komentar nya ya gan...