М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
6г56г
6г56г
27.06.2021 04:41 •  Информатика

Составить программу на паскаль авс.
вычислить значение m по формуле m=2/sin(x), где x изменяется от 1 до 100.

👇
Ответ:
nastyagrigorov
nastyagrigorov
27.06.2021

Можно как то так:

var

M: real;

x: integer;

begin

for x := 1 to 100 do

begin

M := 2 / Sin(x);

Println('x=', x, '; M=', M);

end;

end.

4,8(43 оценок)
Открыть все ответы
Ответ:
masloshick
masloshick
27.06.2021
Romanf romanf отличник 2013-01-10t16: 13: 22+00: 00 1. подумать над алгоритмом 2. вот сам алгоритм: а. спросить у пользователя значения б. расчитать ответ в. выдать ответ на экран 3. написать код в паскале 4. исправить ошибки компиляции 5. протестировать, вводить разные числа 6. обнаружила, что если вводить числа наугад ответ получается отрицательным иногда 7. вставить код проверки введенных пользователем значений 8. убрать ошибки компиляции 9. протестировать 10. готово а вот и сама программа: program aerobus; uses crt; const totalplace = 160; var businessplaces, economyplaces: integer; businessprice, economyprice: real; totalcharge: real; a,b: integer; correctinput: boolean; begin clrscr; businessplaces: =totalplace div 4; economyplaces: = totalplace - businessplaces; writeln('business places count: ', businessplaces); writeln('economy places count: ', economyplaces); correctinput: =false; while not correctinput do begin write('please input business class ticket price: '); readln(businessprice); if(businessprice> 0) then begin correctinput: =true; end else begin writeln('the price should be a positive number, please try again'); end; end; economyprice: =businessprice/2; writeln('economy ticket price is: ', economyprice: 0: 2); correctinput: =false; while not correctinput do begin write('how many business tickets are left? : '); readln(a); if(a> =0) and (a< =businessplaces)then correctinput: =true; if(a< 0) then begin writeln('please input a positive number or 0, please try again'); end; if(a> businessplaces) then begin writeln('please input a number which is less or equal to the tolal business place count, please try again'); end; end; correctinput: =false; while not correctinput do begin write('how many economy tickets are left? : '); readln(b); if(b> =0) and (b< =economyplaces)then correctinput: =true; if(b< 0) then begin writeln('please input a positive number or 0, please try again'); end; if(b> economyplaces) then begin writeln('please input a number which is less or equal to the tolal economy place count, please try again'); end; end; totalcharge: =(businessplaces-a)*businessprice; totalcharge: =totalcharge+(economyplaces-b)*economyprice; writeln('the total charge is: ', totalcharge: 0: 2); writeln; writeln('press enter to exit'); readln; end.
4,6(13 оценок)
Ответ:
kristinapr02
kristinapr02
27.06.2021

def rate_f(movies):

   if len(dictionary[movies]) == 0:

       return True

def film_in_dictionary(movies):

   if movies in dictionary:

       return True

   else:

       return False

def average(movies):

   mean = 0

   for key2 in dictionary[movies].keys():

       mean += dictionary[movies][key2]

   print(f'{movies} средняя оценка: {mean / len(dictionary[movies])}')

dictionary = {}

while True:

   command = input('Введите команду: ')

   if command != 'exit' and command != 'list' and command != 'add' and command != \

           'delete' and command != 'rate' and command != 'find':

       print('Error')

       continue

   if command == 'exit':

       break

   if command == 'list':

       for key in dictionary.keys():

           if rate_f(key):

               print(f'{key} не оценивался')

           else:

               average(key)

       continue

   film = input('Введите название фильма: ')

   if command == 'add':

       if film_in_dictionary(film):

           print('Error')

       else:

           dictionary[film] = {}

   elif command == 'delete':

       if film in dictionary:

           del dictionary[film]

       else:

           print('Error')

   elif command == 'rate':

       name = input('Имя пользователя: ')

       rate = float(input('Оценка: '))

       if 0 < rate <= 10:

           dictionary[film][name] = rate

       else:

           print('Error')

   elif command == 'find':

       if rate_f(film):

           continue

       for name, rate in dictionary[film].items():

           print(f'{name} поставил оценку: {rate}')

       average(film)

4,5(61 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ