-
Notifications
You must be signed in to change notification settings - Fork 7
/
Calculator.bat
61 lines (61 loc) · 1.38 KB
/
Calculator.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@ECHO off
color fc
title Nickfost's Calculator
ECHO -----------------------------------------------------------
ECHO ^|Please enter a number with the corrisponding type of math^|
ECHO ----------------^|1. Addition ^|-----------------------
ECHO ^|2. Subtraction ^|
ECHO ^|3. Multiplication ^|
ECHO ^|4. Division ^|
ECHO -------------------
:start
set/p menu=
if %menu%==1 goto add
if %menu%==2 goto sub
if %menu%==3 goto mul
if %menu%==4 goto div
ECHO sorry that was not a valid response.
ECHO Please try agian
goto start
:q
cls
color 0A
ECHO Please provide the first number %to% %mathtype3% %from%
set/p first=
cls
ECHO Please provide the second number to %mathtype4%
ECHO Your current problem stands at %first% %mathtype2% ? = ?
set/p second=
cls
set /a math= %first% %mathtype2% %second%
ECHO Your result is:
ECHO %first% %mathtype2% %second% = %math%
ECHO Would you like to do another math problem?
ECHO y/n
set/p yehno=
if "%yehno%"=="n" exit
if "%yehno%"=="y" Start Calc.bat
if "%yehno%"=="yes" Start Calc.bat
exit
:add
set mathtype2=+
set mathtype3=add
set to=to
goto q
:sub
set mathtype2=-
set mathtype3=subtract
set mathtype4=subtract
set from=from
set to=to
goto q
:mul
set mathtype2=*
set mathtype3=multiply
set mathtype4=multiply
goto q
:div
set mathtype2=/
set mathtype4= Divide by
goto q
ECHO Nickfost made this :D....