DevioLab CRYPTO TRADING AUTOMATION
LIVE
AUTOMATED CRYPTO TRADING • BINANCE
Автоматизуйте свій криптопортфель
Торгові боти DevioLab аналізують крипторинок, автоматично відкривають і закривають позиції та керують вашим портфелем на Binance 24/7.
CRYPTO 80 Bots
BINANCE Spot Trading
TRADING 24 / 7
Спробувати DevioLab
deviolab.com

Розробка програм розгалуженої структури

Інформація про навчальний заклад

ВУЗ:
Інші
Інститут:
Не вказано
Факультет:
Не вказано
Кафедра:
Не вказано

Інформація про роботу

Рік:
2019
Тип роботи:
Лабораторна робота
Предмет:
Алгоритмічні мови та програмування Частина 2

Частина тексту файла (без зображень, графіків і формул):

Звіт з лабораторної роботи №4 «Розробка програм розгалуженої структури» з дисципліни: «Алгоритмічні мови та програмування» . Лабораторна робота №4 Розробка програм розгалуженої структури The purpose of the work: To learn to make programs of a branched structure. Variant:4 1. + - + - + - C++ code: //function main() declaration int main() { //declaration of variable int x; float y; //displaying text on the screen cout <<"x="; //data input cin>>x; if (x>0 && x<=1) y=-atan((x+3.14)/(pow(x,2))); // executed if x is greater than 0 and less or equal to 1 if (x>1 && x<10) y=log(fabs(pow(x,3))); // executed if x is greater than 1 and less than 10 if (x<=0.10 && x>=0.10) y=exp(-x); // executed if x is less than or equal to 0.10 and greater or equal to 0.10 //displaying the value on the screen cout<<"y="<<y<<endl; //the end return 0; } Result: / 2. + - + - + - C++ code: //declaration of libraries #include <iostream> #include <cmath> using namespace std; //function main() declaration int main() //declaration of variable {double k,l,m,n,p; //displaying text on the screen cout<<"k="; //data input cin>>k; //displaying text on the screen cout<<"l="; //data input cin>>l; if (fabs (n)<5) n=(1-2*k)/2; // executed if fabs (n) is less than 5 if (fabs (m)<5) m=(2*1+k)/1; // executed if fabs (m) is less than 5 if (fabs (p)<5) p=l*k-9.3; // executed if fabs (p) is less than 5 //displaying the value on the screen cout <<"n="<<n<<endl; cout <<"n*n="<<n*n<<endl; cout <<"m="<<m<<endl; cout <<"m*m="<<m*m<<endl; cout <<"p="<<p<<endl; cout <<"p*p="<<p*p<<endl; //the end return 0; } Result: / Conclusion: we learned to make programs of a branched structure in the environment of CodeBlocks and made the programs using the conditional operator - if, which has three operands.
Антиботан аватар за замовчуванням

05.02.2019 20:23

Коментарі

Ви не можете залишити коментар. Для цього, будь ласка, увійдіть або зареєструйтесь.

Ділись своїми роботами та отримуй миттєві бонуси!

Нічого не вибрано
0%

Оголошення від адміністратора

Антиботан аватар за замовчуванням

Подякувати Студентському архіву довільною сумою

Admin

26.02.2023 12:38

Дякуємо, що користуєтесь нашим архівом!