
Написать программу в паскале мясокомбинат получал 6 дней мясо. определить среднее арифметическое
количества мяса полученного за эти дни и найти количество дней когда мясокомбинат получал мяса меньше среднего арефметического

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

держи, п.с. везет вам, проги на дом писать задают), у нас практической части почти нет(
удачи!



To write a program in Pascal to solve this problem, you can follow these steps:
1. Declare an array to store the amount of meat received each day for 6 days. 2. Prompt the user to enter the amount of meat received for each day and store it in the array. 3. Calculate the sum of all the elements in the array to find the total amount of meat received in 6 days. 4. Calculate the average by dividing the total amount of meat by 6. 5. Initialize a counter variable to keep track of the number of days when the meat received is less than the average. 6. Iterate through the array and check if each element is less than the average. If it is, increment the counter. 7. Display the average amount of meat received and the number of days when the meat received was less than the average.
Here's an example program in Pascal that implements the above steps:
```pascal program MeatAverage;
var meatReceived: array[1..6] of Integer; totalMeat, average: Real; daysBelowAverage: Integer; i: Integer;
begin totalMeat := 0; daysBelowAverage := 0;
// Input the amount of meat received for each day for i := 1 to 6 do begin Write('Enter the amount of meat received on day ', i, ': '); Readln(meatReceived[i]); totalMeat := totalMeat + meatReceived[i]; end;
// Calculate the average average := totalMeat / 6;
// Count the number of days when the meat received is less than the average for i := 1 to 6 do begin if meatReceived[i] < average then daysBelowAverage := daysBelowAverage + 1; end;
// Output the average and the number of days below average Writeln('Average amount of meat received: ', average:0:2); Writeln('Number of days when meat received was below average: ', daysBelowAverage); end. ```
This program prompts the user to enter the amount of meat received for each day, calculates the average, and counts the number of days when the meat received was below the average. Finally, it displays the average amount of meat received and the number of days below average.
Please note that this program assumes the user will enter valid input for the amount of meat received each day.


Топ вопросов за вчера в категории Информатика
Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili