Guest User

Untitled

a guest
Oct 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. io.write ("Hey, this script adds, divides, multiplies and subtracts numbers.", "What would you like to do?");
  2. f1 = io.read();
  3. if f1==divide then
  4. io.write ("Alright, whats your first number?")
  5. n1 = io.read();
  6. io.write ("And what is your second number?")
  7. n2 = io.read();
  8. io.write("Answer:", n1/n2, "\n");
  9. elseif f1==add then
  10. io.write ("Alright, whats your first number?")
  11. n1 = io.read();
  12. io.write ("And what is your second number?")
  13. n2 = io.read();
  14. io.write("Answer:", n1+n2, "\n");
  15. elseif f1==subtract then
  16. io.write ("Alright, whats your first number?")
  17. n1 = io.read();
  18. io.write ("And what is your second number?")
  19. n2 = io.read();
  20. io.write("Answer:", n1-n2, "\n");
  21. elseif f1==multiply then
  22. io.write ("Alright, whats your first number?")
  23. n1 = io.read();
  24. io.write ("And what is your second number?")
  25. n2 = io.read();
  26. io.write("Answer:", n1*n2, "\n");
  27. end
Add Comment
Please, Sign In to add comment