Advertisement
Guest User

Calculator/Taschenrechner Code (Small Basic)

a guest
Feb 13th, 2017
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. TextWindow.ForegroundColor = "White"
  2. TextWindow.WriteLine("Hallo, Willkommen zu meinem Tutorial. Wie ist dein Name?")
  3. Name = TextWindow.Read()
  4. TextWindow.WriteLine("Hallo, " +Name)
  5. TextWindow.ForegroundColor = "Red"
  6. TextWindow.WriteLine("Du kannst den Taschenrechner nun verwenden, viel Spaß!")
  7. TextWindow.ForegroundColor = "green"
  8. TextWindow.Write("Bitte gebe die erste Zahl ein ")
  9. Zahl1 = TextWindow.Read()
  10. TextWindow.Write("Bitte gebe nun die Zweite Zahl ein ")
  11. Zahl2 = TextWindow.Read()
  12. TextWindow.Write("Bitte gebe nun den Operator an ")
  13. Operator = TextWindow.Read()
  14. If Operator = "+" Then
  15. Ergebnis = Zahl1 + Zahl2
  16. ElseIf Operator = "-" Then
  17. Ergebnis = Zahl1 - Zahl2
  18. ElseIf Operator = "*" Then
  19. Ergebnis = Zahl1 * Zahl2
  20. ElseIf Operator = "/" Then
  21. Ergebnis = Zahl1 / Zahl2
  22. Else
  23. TextWindow.ForegroundColor = "DarkRed"
  24. TextWindow.WriteLine("Bitte gebe einen Operator ein! ")
  25. EndIf
  26. TextWindow.ForegroundColor = "red"
  27. TextWindow.WriteLine("Ergebnis ="+Ergebnis)
  28. TextWindow.ForegroundColor = "Magenta"
  29.  
  30. TextWindow.WriteLine("Calculator/Taschenrechner Tutorial by SlashCodings!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement