Вопрос задан 26.04.2019 в 23:40. Предмет Информатика. Спрашивает Kaverina Margarita.

Написать калькулятор (.bat) файл СРОЧНО.....

0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Байер Тема.
@echo off @title calc color 70 mode con: cols=30 lines=3 :path echo. set /p var=":" cls echo %var% set /p var1=":" cls echo %var%%var1% set /p var2=":" cls set /a var3=%var%%var1%%var2% echo %var%%var1%%var2%=%var3% pause>nul cls goto path

после ввода каждой переменной нажимать Enter... работает как обычный калькулятор.
P.S не отображает десятые и сотые доли чисел.


0 0
Отвечает Маршал Вадим.
@echo offtitle Calculator from Binary Codecolor 0b:startecho -------------------------echo Welcome to the Calculatorecho -------------------------echo.set /p sum=Please enter the question:echo.set /a ans = %sum%echo.echo The Answer = %ans%echo.echo =========================pauseclsecho Previous Answer = %ans%echo -------------------------echo.goto startexit?


Такой?
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Creating a Calculator.bat File

To create a calculator.bat file, you can use the Windows Command Prompt to write a batch script. Here's a step-by-step guide on how to create a simple calculator.bat file:

1. Open a text editor such as Notepad. 2. Start the file with the `@echo off` command to turn off command echoing. 3. Use the `set /p` command to prompt the user for input. For example, you can ask the user to enter the first number: `set /p num1=Enter the first number:`. 4. Repeat step 3 to prompt the user for the second number: `set /p num2=Enter the second number:`. 5. Use the `set /a` command to perform arithmetic operations. For example, to add the two numbers, you can use `set /a result=num1+num2`. 6. Display the result using the `echo` command: `echo The result is: %result%`. 7. Save the file with the .bat extension, such as calculator.bat.

Here's an example of a simple calculator.bat file that adds two numbers:

```bat @echo off set /p num1=Enter the first number: set /p num2=Enter the second number: set /a result=num1+num2 echo The result is: %result% ```

You can customize the script to perform other arithmetic operations such as subtraction, multiplication, and division by modifying the `set /a` command accordingly.

Please note that the above instructions assume you are using a Windows operating system. If you are using a different operating system, the steps may vary.

I hope this helps! Let me know if you have any further questions.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос