
написать программу в Pascal и составить её блок -схему: по возрасту, введённому с клавиатуры,
определить, к какой возрастной группе относится человек: от 0 до 7 лет дошкольник. от 8 до 17 лет школьник, от 18 до 23 лет студент, 24-55 лет работник, от 56 лет и старше пенсионер.

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

var
l:integer;
begin
writeln('skolko let?');
readln(l);
if (l>=0) and (l<=7) then
writeln('Doshkolnik')
else if (l>=8) and (l<=17) then
writeln('shkolnik')
else if (l>=18) and (l<=23) then
writeln('student')
else if (l>=24) and (l<=55) then
writeln('rabotnik')
else if l>=56 then
writeln('pensioner');
end.



var
a:integer;
begin
write('Введите возраст '); readln(a);
write('Этот человек ');
case a of
0..7: writeln('дошкольник');
8..17: writeln('школьник');
18..23: writeln('студент');
24..55: writeln('работник');
else
writeln('пенсионер');
end;
end.



Program in Pascal to Determine Age Group
Here is a program in Pascal that determines the age group based on the age entered from the keyboard:
```pascal program AgeGroup;
var age: integer;
begin writeln('Enter your age:'); readln(age);
if (age >= 0) and (age <= 7) then writeln('You belong to the preschool age group.'); if (age >= 8) and (age <= 17) then writeln('You belong to the school age group.'); if (age >= 18) and (age <= 23) then writeln('You belong to the student age group.'); if (age >= 24) and (age <= 55) then writeln('You belong to the working age group.'); if (age >= 56) then writeln('You belong to the retirement age group.');
readln; end. ```
Block Diagram
Here is a block diagram representing the logic of the program:
``` Start | |--- Read age from keyboard | |--- If age >= 0 and age <= 7 | | | |--- Print "You belong to the preschool age group." | |--- If age >= 8 and age <= 17 | | | |--- Print "You belong to the school age group." | |--- If age >= 18 and age <= 23 | | | |--- Print "You belong to the student age group." | |--- If age >= 24 and age <= 55 | | | |--- Print "You belong to the working age group." | |--- If age >= 56 | | | |--- Print "You belong to the retirement age group." | End ```
Please note that this program assumes the age entered is a positive integer.


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







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