Advertisement
Mhazard

[BaT] Command Prompt Calculator for BaT. format Notepad

Jul 16th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. @echo off
  2. Title calculator
  3. Color 1f
  4. :start
  5. echo Command Prompt Calculator
  6. echo Press 1 for Addition
  7. echo Press 2 for Subtraction
  8. echo Press 3 for Multiplication
  9. echo Press 4 for Division
  10. echo Press 5 for Randomizer
  11. echo Press 6 to Clear
  12. echo Press 7 to Quit
  13. set /p type=
  14. if %type%==1 goto a
  15. if %type%==2 goto b
  16. if %type%==3 goto c
  17. if %type%==4 goto d
  18. if %type%==5 goto e
  19. if %type%==6 goto f
  20. if %type%==7 goto g
  21. :a
  22. echo Addition
  23. echo Please choose the 2 numbers you wish to add
  24. echo Type the first number
  25. set /p num1=
  26. echo Type the second number
  27. set /p num2=
  28. echo %num1%+%num2%?
  29. pause
  30. set /a Answer=%num1%+%num2%
  31. echo %Answer%
  32. pause
  33. goto start
  34. :b
  35. echo Subtraction
  36. echo Please choose the 2 numbers you wsh to subtract
  37. echo Type the first number
  38. set /p num1=
  39. echo Type the second number
  40. set /p num2=
  41. echo %num1%-%num2%?
  42. pause
  43. set /a Answer=%num1%-%num2%
  44. echo %Answer%
  45. pause
  46. goto start
  47. :c
  48. echo Multiplication
  49. echo Please choose the 2 numbers you wish to multiply
  50. set /p num1=
  51. set /p num2=
  52. echo %num1%*%num2%?
  53. pause
  54. set /a Answer=%num1%*%num2%
  55. echo %Answer%
  56. pause
  57. goto start
  58. :d
  59. echo Division
  60. echo Please choose the 2 numbers you wish to divide
  61. echo Type the first number
  62. set /p num1=
  63. echo Type the second number
  64. set /p num2=
  65. echo %num1%/%num2%?
  66. pause
  67. set /a Answer=%num1%/%num2%
  68. echo %Answer%
  69. pause
  70. goto start
  71. :e
  72. echo Randomizer
  73. echo Please guess what number it will project (0-99999)
  74. pause
  75. echo %random%
  76. pause
  77. goto start
  78. :f
  79. cls
  80. goto start
  81. :g
  82. cls
  83. echo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement