An official Batch Programming blog! To Solve the daily problems with windows and fixing them with little notepad scripts. Unlock the Hidden Secrets of Windows, Learn to crack Software via CMD & Make your own Programming tools. Understand to Manipulate your PC via CMD.

Calculating Area of Basic Shapes by Batch -(beginners)

Calculating area of basic shapes ( like… Square, rectangle, triangle, circle ) is an easier task.

But, it becomes difficult when you have to make a computer understand – ‘That “How to make these calculations”, and as you know cmd doesn’t support float values.

AREA OF BASIC SHAPES:

It only can calculate integer values but in this program, I’ve used a trick to show exact result of Circle, triangle’s area, Up-to 5 decimal places.

I’ll use the same trick to make a Batch function, which will help us in calculating floating-point calculations easily in the cmd environment.

The program is a simple CUI (character user-interface) program. I’ve created it only on the request of a viewer, I forgot his name (and the source of his request too).

But, the program can teach us, the basics of calculation making in the cmd environment and the general syntax related to it.

The interaction with the program is very simple and kinda stupid as in this Gui world, we can’t expect this kind of input method from the user.Although the program is very simple to edit and understand,.

you can open it in any text editor program e.g. notepad, notepad++, sublime text editor etc.

The program can help in calculating area of basic shapes like triangles, circles, rectangles, etc. You can modify it and create something new out of it. I hope you’ll not criticize this small but effective in the learning program.

I’ll wait for your replies in the comment field any suggestions, complaints, appreciations are welcomed.

Keep learning, keep sharing….
Be happy, spread happiness…

TheBATeam
Also Read:  Algorithm for calculating floating point numbers| By kvc

Next Post

Previous Post

Leave a Reply

© 2020 TheBATeam

Theme by Anders Norén