Create A Calculator With A Notepad










Today I will show you to create a calculator with a notepad.
First Go o start menu > Run and type notepad and hit enter.










Now type the code bellow :


@echo off
color 4
title CALCULATOR VERSION 1.2
:loop
cls
echo by 24 Tutorial
echo _
echo by mail2tuto@gmail.com
echo.
echo Calculator Version 1.2
echo -----------------------------------------------
echo * = MULTIPLY
echo + = ADD
echo - = SUBTRACT
echo 2 = SQUARED
echo / = DIVIDE
echo After an equation, type CLEAR to clear the screen of your equations, type KEEP to leave them there, or type EXIT to leave.
:noclear
set /p UDefine=
set /a UDefine=%UDefine%
echo.
echo =
echo.
echo %UDefine%
echo KEEP, CLEAR, OR EXIT?
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==KEEP echo. && goto noclear
if %clearexitkeep%==EXIT (exit)
:misspell
echo.
echo -----------------------------------------------
echo You misspelled your command. Please try again (make sure you are typing in all caps LIKE THIS).
echo Commands:
echo CLEAR Clear all previous equations and continue calculating.
echo KEEP Keep all previous equations and continue calculating.
echo EXIT Leave your calculating session
echo Enter in a command now.
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==EXIT (exit)
if %clearexitkeep%==KEEP goto noclear
goto misspell

Now Click File>Save as and save the file as my calculator.bat. Remember .bat
Now open your own calculator .


Edit :
To change color go to run and type cmd and hit enter.
You will see a command window. Now type help color and hit enter.
You will find some color code.

1 comment:

  1. Thank you again for your post. Now I can create my own calculater. :)

    ReplyDelete

BTCClicks.com 9Earn Bitcoin)