Вопрос задан 30.04.2019 в 16:11. Предмет Информатика. Спрашивает Синёв Дима.

Составьте программу в паскаль с помощью while. Стакан кипятка (100 °С) остыл за первую минуту на А

градусов, а каждую последующую минуту остывал на 15% меньше, чем в предыдущую. Через сколько минут температура воды станет ниже Nо С?
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Фітак Рома.
Var A, gradus, minut, N: real;
Begin
Writeln('Введите A градусов');
readln(A);
Writeln('До какой температуры остужать:');
readln(N);
gradus:=100-A;minut:=1;
While (gradus>N) do
Begin
   A:=A*(1-0.15);
    gradus:=gradus-A;
    minut:=minut+1;
 end;

Writeln('Кипяток остынет до ',N,' градусов через ', minut, ' минут');
readln();
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program in Pascal using a while loop to calculate the time it takes for the temperature of water to drop below a certain value

Here's a program written in Pascal that uses a while loop to calculate the time it takes for the temperature of water to drop below a certain value:

```pascal program WaterTemperature; var initialTemperature, currentTemperature, targetTemperature: real; time: integer; begin initialTemperature := 100; // Initial temperature of the water in degrees Celsius targetTemperature := 70; // Target temperature in degrees Celsius currentTemperature := initialTemperature; time := 0;

while currentTemperature > targetTemperature do begin currentTemperature := currentTemperature - (currentTemperature * 0.15); // Decrease temperature by 15% each minute time := time + 1; // Increment time by 1 minute end;

writeln('The temperature of the water will drop below ', targetTemperature:0:2, ' degrees Celsius after ', time, ' minutes.'); end. ```

In this program, we initialize the initial temperature of the water to 100 degrees Celsius and the target temperature to 70 degrees Celsius. We use a while loop to continuously decrease the current temperature by 15% each minute until it drops below the target temperature. The time variable keeps track of the number of minutes it takes for the temperature to drop below the target temperature. Finally, we display the result using the `writeln` statement.

Please note that the program assumes a constant rate of temperature decrease of 15% each minute. If the rate of temperature decrease changes over time, the program may not provide an accurate result.

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

0 0

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

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

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