How to Make a Calculator With Command Promt
by WaterLemon7 in Circuits > Computers
12089 Views, 5 Favorites, 0 Comments
How to Make a Calculator With Command Promt
hey guys, this can help you in maths classes :) this is a simple calculator that also lets you change the colour at the start by typing in a colour code. colour codes can be shown if yout type z when your asked to choose one. because sreenshots werent working i can only give you the codes
The Code
to make the calculator simply copy and paste this code into notepad then save it as a .bat
@echo off
title calculator
color 0f
echo.
echo.
echo ___________________________________________________________________
echo -
echo Colour Changer, Type In The Colour Code You Want Then Press Enter.-
echo -
echo ___________________________________________________________________
echo.
echo.
set /p code=colour Code:
color %code%
cls
goto top
:top
echo Colour Code: %code%
echo ________________________________________________________________
echo -
echo My Calculator -
echo Just Type In Your problem Sum And press Enter -
echo Add=+ Subtract=- Multiply=* Divide=/ previous answer=ans -
echo Note: Answers For Division Are Rounded Off -
echo -
echo ________________________________________________________________
echo.
set /p prob=
set /a ans=%prob%
echo.
echo =%ans%
echo ________________________________________________________________
pause
cls
echo Previous Answer: %Ans%
goto top
pause
exit
@echo off
title calculator
color 0f
echo.
echo.
echo ___________________________________________________________________
echo -
echo Colour Changer, Type In The Colour Code You Want Then Press Enter.-
echo -
echo ___________________________________________________________________
echo.
echo.
set /p code=colour Code:
color %code%
cls
goto top
:top
echo Colour Code: %code%
echo ________________________________________________________________
echo -
echo My Calculator -
echo Just Type In Your problem Sum And press Enter -
echo Add=+ Subtract=- Multiply=* Divide=/ previous answer=ans -
echo Note: Answers For Division Are Rounded Off -
echo -
echo ________________________________________________________________
echo.
set /p prob=
set /a ans=%prob%
echo.
echo =%ans%
echo ________________________________________________________________
pause
cls
echo Previous Answer: %Ans%
goto top
pause
exit
Test It Out!
test it out if there are any problems just comment, feel free to change it just please give me credit. also thanks to my friend for helping me with the codes. hope it works and have fun! if it doesn't work post a comment about the problem and code and ill show see if i can find the problem, or if my friend can.