Advertisement
Guest User

Batch Calculator

a guest
Oct 31st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.18 KB | None | 0 0
  1. @echo off
  2. title Calculator
  3. color 0a
  4. echo Welcome to The Basic Arithmetic Calculator
  5. echo Made By Christopher Drake
  6. ping localhost -n 3 >nul
  7.  
  8. :LOADING
  9. cls
  10. echo Loading.
  11. ping localhost -n 2 >nul
  12. cls
  13. echo Loading..
  14. ping localhost -n 2 >nul
  15. cls
  16. echo Loading...
  17. ping localhost -n 2 >nul
  18. cls
  19. echo Loading....
  20. ping localhost -n 2 >nul
  21. cls
  22. echo Loading.....
  23. ping localhost -n 2 >nul
  24. ping localhost -n 2 >nul
  25. color 0a
  26.  
  27. :START
  28. cls
  29. echo What Type of Math would you like to do?
  30. echo Add, Subtract, Multiply, or Divide.
  31. set /p math=
  32. IF '%math%' == 'Add' GOTO ADD
  33. IF '%math%' == 'add' GOTO ADD
  34. IF '%math%' == 'Subtract' GOTO SUB
  35. IF '%math%' == 'subtract' GOTO SUB
  36. IF '%math%' == 'Multiply' GOTO MULTIPLY
  37. IF '%math%' == 'multiply' GOTO MULTIPLY
  38. IF '%math%' == 'Divide' GOTO DIVIDE
  39. IF '%math%' == 'divide' GOTO DIVIDE
  40. Exit
  41.  
  42. :ADD
  43. Cls
  44. GOTO NUMBERSADD
  45. pause
  46. exit
  47.  
  48. :SUB
  49. Cls
  50. GOTO NUMBERSSUB
  51. pause
  52. exit
  53.  
  54. :MULTIPLY
  55. Cls
  56. GOTO NUMBERSMULTIPLY
  57. pause
  58. exit
  59.  
  60. :DIVIDE
  61. Cls
  62. GOTO NUMBERSDIVIDE
  63. pause
  64. exit
  65.  
  66. :NUMBERSADD
  67. echo What is the First Number you would like to Add?
  68. set /p number1=
  69. cls
  70. echo What is the Second Number you would like to Add?
  71. set /p number2=
  72. cls
  73.  
  74. GOTO ADD2
  75. exit
  76.  
  77. :NUMBERSSUB
  78. echo What is the First Number you would like to Subtract?
  79. set /p number1=
  80. cls
  81. echo What is the Second Number you would like to Subtract?
  82. set /p number2=
  83. cls
  84. GOTO SUB2
  85. exit
  86.  
  87. :NUMBERSMULTIPLY
  88. echo What is the First Number you would like to Multiply?
  89. set /p number1=
  90. cls
  91. echo What is the Second Number you would like to Multiply?
  92. set /p number2=
  93. cls
  94. GOTO MULTIPLY2
  95. exit
  96.  
  97. :NUMBERSDIVIDE
  98. echo What is the First Number you would like to Divide?
  99. set /p number1=
  100. cls
  101. echo What is the Second Number you would like to Divide?
  102. set /p number2=
  103. cls
  104. GOTO DIVIDE2
  105. exit
  106.  
  107. :ADD2
  108. Set /A result = %number1% + %number2%
  109. echo The answer is %result%.
  110. Pause
  111. GOTO START
  112. exit
  113.  
  114. :SUB2
  115. Set /A result = %number1% - %number2%
  116. echo The answer is %result%.
  117. pause
  118. GOTO START
  119. exit
  120.  
  121. :MULTIPLY2
  122. Set /A result = %number1% * %number2%
  123. echo The answer is %result%.
  124. pause
  125. GOTO START
  126. exit
  127.  
  128. :DIVIDE2
  129. Set /A result = %number1% / %number2%
  130. echo The answer is %result%.
  131. pause
  132. GOTO START
  133. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement