SlideShare a Scribd company logo
Лабораторна робота 5
ПРОГРАМУВАННЯ ЛІНІЙНИХ ОБЧИСЛЮВАЛЬНИХ
ПРОЦЕСІВ
Мета: Набуття практичних навичок при введенні та виведенні даних.
Розвивати уміння застосувати поля редагування TextBox, текстові поля Label,
керуючі кнопки Command Button та властивості об’єктів (Caption, Font, Back
Color). Вміти оголошувати змінні; надавати змінним значення властивостей
елементів керування,
ТЕОРЕТИЧНИЙ МАТЕРІАЛ:
Об’єкти типу Text Box використовуються для введення рядка символів з
клавіатури.
Змінна – це величина, яка змінюється в процесі виконання програми.
Оператор оголошення змінної: Dim Ім’я змінної As тип даних
Напр. Dim А1 As Single.
Константа – величина, значення якої неможна змінювати в процесі виконання
програми.
Оператор оголошення константи: Const Ім’я Константи =Значення
Напр.: Const Pi=3.1415
Оператор Dim тільки виділяє поле пам’яті під змінну, в яке в подальшому
можна поміщати різні значення із зазначеного типу.
Стандартні типи даних
Тип Назва Діапазон чисел
Boolean Булівський
Integer Цілий -32 768…32767
Single Дробове одинарної точності +/- 1.4*10-4 5
…3.4*1038
Curren-
cy
Грошовий +/- 9*1014
Величини, які беруть участь у різних операціях (додавання,
віднімання…), називають операндами
При застосування до цілих операндів такі операції дають цілі значення:
+, -, *,  (ділення націло, напр. 132=6) , Mod (залишок від ділення,
напр. 13 mod 2=1), ^(піднесення до степеня).
Функції
Цілий результат дають такі вмонтовані функції:
Abs(x) –|х|- абсолютне значення х;
Fic(x) – ціле число, що дорівнює числу х без дробової частини; Fic(21,3)=21
Int(x) – найбільше ціле, що не перевищує х; Int(28,6)=28
Дійсний результат завжди дають математичні функції:
Sin(x), Cos(x), Tan(x), Atn(x), Ln(x), Exp(x), √х = 𝒔𝒒𝒓(𝒙)
Round(x,n) – округлення чисел; де х – дробове число, n – кількість чисел у
дробовій частині , Round(3.74, 1)=3.7;
За умови, що хоча б один з операторів належить до дійсного типу (інший
може бути й цілим), такі операції дають дійсний результат: +, -, *, / (ділення –
результат завжди дійсний), ^. х2
=х^2 (^ - піднесення до степеню);
Подвійна математична нерівність a<x<b в інформатиці записується у
вигляді
(a<x) And (x<b). And -і ; Or –або .
Приклад опису математичного виразу мовою програмування Visual Basic
𝑥
2𝑦
+ √𝑎 ∗ 𝑏 − sin 𝑥 + 𝑡𝑔𝑥 − |𝑎| = 𝑥
2 ∗ 𝑦
⁄ + 𝑠𝑞𝑟(𝑎 ∗ 𝑏) − sin(𝑥) + tan(𝑥) − 𝑎𝑏𝑠(𝑎)
Види вбудованих функцій :
InputBox використовується для введення даних
InputBox (Підказка [, Заголовок вікна ])
MsgBox використовується для виведення повідомлень
MsgBox(Повідомлення, Кнопки + Значок, Заголовок)
Str Перетворює числове значення в символьне
Str (число)
a=”12”
b=”10”
Print a+b
1210
Print
Val(a)+val(b)
22
Val Перетворює символьний рядок в числове значення
Val(символьний рядок)
ХІД РОБОТИ:
Завдання №1: Створити форму з назвою «Обчислення », на який можна
змоделювати обчислення виразу: 𝑑 =
𝑎
𝑏
+ √𝑐
1. Завантажте середовище Visual Basic(Пуск/Все программы Visual Basic )
2. Вставте у форму п’ять об’єктів типу Label (як показано на мал.).
3. Вставте у форму
поле редагування - об’єкт
TextBox. Для цього клацнуть на
піктограмі об’єкти типу Text Box.
4. Вставте у форму кнопку –
об’єкт типу Command Button (як
показано на мал.). Введіть назву
кнопки – Обчислення виразу 1.
Label 1
Label 2
Label 3
Label 4
TextBox 1
TextBox 2
TextBox 3
Label 5
Command Button 1
5. Змініть назву з Label 1, Label 2, Label 3, Label 4. Використати
властивість – Caption).. Label 5 – залишити без назви.
6. Змініть назву форми з Form1 на «Обчислення”.(Використати
властивість – Caption).
7. Запрограмуйте кнопку „Обчислити значення виразу”.
Завдання №2. Доопрацюйте форму «Обчислення » таким чином, щоб введення
даних здійснювалися за допомогою функції InputBox, а виведення – MsgBox.
На форму вставте кнопку Command Button, перейменуйте - Обчислення виразу
2. Запрограмуйте кнопку по зразку:
Завдання для самостійного виконання:
Спеціальність ТОРО Визначити контактне напруження в поверхневому
шарі зубців шестеренної кліті за формулою:
𝐺𝑘 =
240
𝑎𝑤
√
𝑀𝑝(𝑢+1)3
𝑏∙4
МПа (1), де
Мр=500106
Н*мм;
U=1;
b=830 мм;
aw=500 мм.
Перевірка результату: Gk=1331
Спеціальність ОМТ Початкова товщина штаби h0=15мм; кінцева
товщина h1=10 мм; діаметр валків D=550мм.
Розрахувати кут захоплення в радіанах.
Формула обчислення абсолютного обтиску
∆ℎ = ℎ0 − ℎ1 (1),
Формула обчислення кута захоплення в радіанах
𝛼 = √
∆ℎ
𝑅
= √
2(ℎ0−ℎ1)
𝐷
(2)
Перевірка результату: h = 5, =0.135
Спеціальність ЗВ Визначте силу зварювального струму Ізв, діаметр
зварювального дроту de, напругу на дузі Ug. Відомо, що
коефіцієнт пропорційності - Кn=1.1; товщина металу,
що зварюється - S=6 мм, h - глибина проплавлення -
h=0.8- S (мм);
Дані для
перевірки
a 4
b 2
c 9
d 5
n
зв
K
h
I
100


, А (1)
i
I
d зв
е 13
.
1

, мм (2)
де і-допустима щільність струму, А/мм2
і=30
ел
зв
d
I
Ug



06
.
0
25
, В (4)
Перевірка результату: I zv = 436.36, de=4.31,
Ug = 1.88
Спеціальність ВПМ Визначити критерій Рейнольдца для руху рідини в
трубопроводі, який має в січенні круг діаметром
d=0,08м., витрати рідини V=5 м3
/год, коефіцієнт
динамічної в’язкості =0,39610-3 Н∙с
м𝟐
,
густина рідини
=785кг/м3
.
𝑹𝒆 =
𝝎∙𝒅∙𝝆
𝝁
(1)
V=S (2)
S – площа поперечного перерізу каналу, м2
𝑆 =
𝝅∙𝒅𝟐
𝟒
(3)
𝝎 =
𝑽
𝑺
∗ 𝟑𝟔𝟎𝟎 (4)
Перевірка результату: Re = 43841.190
КОНТРОЛЬНІ ЗАПИТАННЯ:
1. Призначення об’єкту TextBox.
2. Дати визначення змінної, константи.
3. Яким чином здійснюється опис змінних, констант в середовищі Visual Basic?
4. Які величини називають операндами:
5. Які типи даних вам відомі?
6. Які вмонтовані функції дають цілий, дійсний результат?
7. Які вбудовані функції для введення та виведення даних вам відомі? Правила їх
застосування.
8. Виконати обчислення
Fic(20.7)+Fic(141.89)-Fic(-15.7)+Round(3.25,1)-Round(6.891,2)+Round(-
3.472,1)+15 mod2 -152;
9. Записати математичні вирази мовою програмування:
𝑏3
+ 𝑐4
∗
3𝑑
(5 + 𝑎)
; |𝑎3
+ 𝑏| − 𝑡𝑔𝑥 + 𝑠𝑖𝑛𝑥; 𝑠𝑖𝑛
√2 + 𝑥
2𝑥
10* Намалювати блок схему до самостійного завдання.

More Related Content

What's hot

Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
홍배 김
 
STLD- Switching functions
STLD- Switching functions STLD- Switching functions
STLD- Switching functions
Abhinay Potlabathini
 
Python Programming
Python Programming Python Programming
Python Programming
Sreedhar Chowdam
 
Chapter2
Chapter2Chapter2
Chapter2
Nashra Akhter
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
vikram mahendra
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
Farhan Ab Rahman
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
stasimus
 
Python crush course
Python crush coursePython crush course
Python crush course
Mohammed El Rafie Tarabay
 
Google TensorFlow Tutorial
Google TensorFlow TutorialGoogle TensorFlow Tutorial
Google TensorFlow Tutorial
台灣資料科學年會
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
Namgee Lee
 
TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow Tutorial
NamHyuk Ahn
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
Mohammed El Rafie Tarabay
 
Functions and Relations
Functions and RelationsFunctions and Relations
Functions and Relations
Jailah13
 
Unit 1(stld)
Unit 1(stld)Unit 1(stld)
Unit 1(stld)
Abhinay Potlabathini
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
SaeedShahAhmed
 
Pointers
PointersPointers
Pointers
rajshreemuthiah
 
Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]
Palak Sanghani
 
Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning Programmers
Kimikazu Kato
 
State of the ART in Boolean Functions Cryptographic Assessment
State of the ART in Boolean Functions Cryptographic AssessmentState of the ART in Boolean Functions Cryptographic Assessment
State of the ART in Boolean Functions Cryptographic Assessment
ijcncs
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
KristhyanAndreeKurtL
 

What's hot (20)

Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
STLD- Switching functions
STLD- Switching functions STLD- Switching functions
STLD- Switching functions
 
Python Programming
Python Programming Python Programming
Python Programming
 
Chapter2
Chapter2Chapter2
Chapter2
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
 
Python crush course
Python crush coursePython crush course
Python crush course
 
Google TensorFlow Tutorial
Google TensorFlow TutorialGoogle TensorFlow Tutorial
Google TensorFlow Tutorial
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
 
TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow Tutorial
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
 
Functions and Relations
Functions and RelationsFunctions and Relations
Functions and Relations
 
Unit 1(stld)
Unit 1(stld)Unit 1(stld)
Unit 1(stld)
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Pointers
PointersPointers
Pointers
 
Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]Lec 7 28_aug [compatibility mode]
Lec 7 28_aug [compatibility mode]
 
Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning Programmers
 
State of the ART in Boolean Functions Cryptographic Assessment
State of the ART in Boolean Functions Cryptographic AssessmentState of the ART in Boolean Functions Cryptographic Assessment
State of the ART in Boolean Functions Cryptographic Assessment
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
 

Similar to Lr5

More instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docxMore instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docx
gilpinleeanna
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
ssuser3cbb4c
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0
Sheik Uduman Ali
 
Lec 9 05_sept [compatibility mode]
Lec 9 05_sept [compatibility mode]Lec 9 05_sept [compatibility mode]
Lec 9 05_sept [compatibility mode]
Palak Sanghani
 
Rumus VB-2
Rumus VB-2Rumus VB-2
Rumus VB-2
T. Astari
 
Matlab 1
Matlab 1Matlab 1
Matlab 1
asguna
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
imtiazalijoono
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
simenehanmut
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
alish sha
 
Gentlest Introduction to Tensorflow
Gentlest Introduction to TensorflowGentlest Introduction to Tensorflow
Gentlest Introduction to Tensorflow
Khor SoonHin
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance Haskell
Johan Tibell
 
C++ basics
C++ basicsC++ basics
C++ basics
ndargolis
 
Xgboost
XgboostXgboost
C++ Language
C++ LanguageC++ Language
C++ Language
Syed Zaid Irshad
 
Lecture 9_Classes.pptx
Lecture 9_Classes.pptxLecture 9_Classes.pptx
Lecture 9_Classes.pptx
NelyJay
 
Boolean Function Forms
Boolean Function FormsBoolean Function Forms
Boolean Function Forms
Hashni T
 
Python 培训讲义
Python 培训讲义Python 培训讲义
Python 培训讲义
leejd
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
Abd El Kareem Ahmed
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
mohanrathod18
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2

Similar to Lr5 (20)

More instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docxMore instructions for the lab write-up1) You are not obli.docx
More instructions for the lab write-up1) You are not obli.docx
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0
 
Lec 9 05_sept [compatibility mode]
Lec 9 05_sept [compatibility mode]Lec 9 05_sept [compatibility mode]
Lec 9 05_sept [compatibility mode]
 
Rumus VB-2
Rumus VB-2Rumus VB-2
Rumus VB-2
 
Matlab 1
Matlab 1Matlab 1
Matlab 1
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
Gentlest Introduction to Tensorflow
Gentlest Introduction to TensorflowGentlest Introduction to Tensorflow
Gentlest Introduction to Tensorflow
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance Haskell
 
C++ basics
C++ basicsC++ basics
C++ basics
 
Xgboost
XgboostXgboost
Xgboost
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Lecture 9_Classes.pptx
Lecture 9_Classes.pptxLecture 9_Classes.pptx
Lecture 9_Classes.pptx
 
Boolean Function Forms
Boolean Function FormsBoolean Function Forms
Boolean Function Forms
 
Python 培训讲义
Python 培训讲义Python 培训讲义
Python 培训讲义
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2
Advanced C - Part 2
 

More from metallurg056

polojentya2022.pdf
polojentya2022.pdfpolojentya2022.pdf
polojentya2022.pdf
metallurg056
 
prpriyomy20222222.pdf
prpriyomy20222222.pdfprpriyomy20222222.pdf
prpriyomy20222222.pdf
metallurg056
 
struktura fondy.pdf
struktura fondy.pdfstruktura fondy.pdf
struktura fondy.pdf
metallurg056
 
Formi oplati npaci.pdf
Formi oplati npaci.pdfFormi oplati npaci.pdf
Formi oplati npaci.pdf
metallurg056
 
rentabelnist.pdf
rentabelnist.pdfrentabelnist.pdf
rentabelnist.pdf
metallurg056
 
Pr#1 ekonomika
Pr#1 ekonomikaPr#1 ekonomika
Pr#1 ekonomika
metallurg056
 
Pravilapriyomu2022
Pravilapriyomu2022Pravilapriyomu2022
Pravilapriyomu2022
metallurg056
 

More from metallurg056 (20)

polojentya2022.pdf
polojentya2022.pdfpolojentya2022.pdf
polojentya2022.pdf
 
prpriyomy20222222.pdf
prpriyomy20222222.pdfprpriyomy20222222.pdf
prpriyomy20222222.pdf
 
PR4 PM.pdf
PR4 PM.pdfPR4 PM.pdf
PR4 PM.pdf
 
struktura fondy.pdf
struktura fondy.pdfstruktura fondy.pdf
struktura fondy.pdf
 
Formi oplati npaci.pdf
Formi oplati npaci.pdfFormi oplati npaci.pdf
Formi oplati npaci.pdf
 
pr311.pdf
pr311.pdfpr311.pdf
pr311.pdf
 
pr#10.pdf
pr#10.pdfpr#10.pdf
pr#10.pdf
 
rentabelnist.pdf
rentabelnist.pdfrentabelnist.pdf
rentabelnist.pdf
 
Pributok
PributokPributok
Pributok
 
Dohid
DohidDohid
Dohid
 
#9 pr hti
#9 pr hti#9 pr hti
#9 pr hti
 
№10 pr
№10 pr№10 pr
№10 pr
 
Instruktaj
InstruktajInstruktaj
Instruktaj
 
Nakazd
NakazdNakazd
Nakazd
 
Pr#9
Pr#9Pr#9
Pr#9
 
Pr#1
Pr#1Pr#1
Pr#1
 
Pr#1 ekonomika
Pr#1 ekonomikaPr#1 ekonomika
Pr#1 ekonomika
 
Pravilapriyomu2022
Pravilapriyomu2022Pravilapriyomu2022
Pravilapriyomu2022
 
Lr7
Lr7Lr7
Lr7
 
Lr6
Lr6Lr6
Lr6
 

Recently uploaded

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 

Lr5

  • 1. Лабораторна робота 5 ПРОГРАМУВАННЯ ЛІНІЙНИХ ОБЧИСЛЮВАЛЬНИХ ПРОЦЕСІВ Мета: Набуття практичних навичок при введенні та виведенні даних. Розвивати уміння застосувати поля редагування TextBox, текстові поля Label, керуючі кнопки Command Button та властивості об’єктів (Caption, Font, Back Color). Вміти оголошувати змінні; надавати змінним значення властивостей елементів керування, ТЕОРЕТИЧНИЙ МАТЕРІАЛ: Об’єкти типу Text Box використовуються для введення рядка символів з клавіатури. Змінна – це величина, яка змінюється в процесі виконання програми. Оператор оголошення змінної: Dim Ім’я змінної As тип даних Напр. Dim А1 As Single. Константа – величина, значення якої неможна змінювати в процесі виконання програми. Оператор оголошення константи: Const Ім’я Константи =Значення Напр.: Const Pi=3.1415 Оператор Dim тільки виділяє поле пам’яті під змінну, в яке в подальшому можна поміщати різні значення із зазначеного типу. Стандартні типи даних Тип Назва Діапазон чисел Boolean Булівський Integer Цілий -32 768…32767 Single Дробове одинарної точності +/- 1.4*10-4 5 …3.4*1038 Curren- cy Грошовий +/- 9*1014 Величини, які беруть участь у різних операціях (додавання, віднімання…), називають операндами При застосування до цілих операндів такі операції дають цілі значення: +, -, *, (ділення націло, напр. 132=6) , Mod (залишок від ділення, напр. 13 mod 2=1), ^(піднесення до степеня). Функції Цілий результат дають такі вмонтовані функції: Abs(x) –|х|- абсолютне значення х; Fic(x) – ціле число, що дорівнює числу х без дробової частини; Fic(21,3)=21 Int(x) – найбільше ціле, що не перевищує х; Int(28,6)=28 Дійсний результат завжди дають математичні функції: Sin(x), Cos(x), Tan(x), Atn(x), Ln(x), Exp(x), √х = 𝒔𝒒𝒓(𝒙) Round(x,n) – округлення чисел; де х – дробове число, n – кількість чисел у дробовій частині , Round(3.74, 1)=3.7; За умови, що хоча б один з операторів належить до дійсного типу (інший може бути й цілим), такі операції дають дійсний результат: +, -, *, / (ділення – результат завжди дійсний), ^. х2 =х^2 (^ - піднесення до степеню);
  • 2. Подвійна математична нерівність a<x<b в інформатиці записується у вигляді (a<x) And (x<b). And -і ; Or –або . Приклад опису математичного виразу мовою програмування Visual Basic 𝑥 2𝑦 + √𝑎 ∗ 𝑏 − sin 𝑥 + 𝑡𝑔𝑥 − |𝑎| = 𝑥 2 ∗ 𝑦 ⁄ + 𝑠𝑞𝑟(𝑎 ∗ 𝑏) − sin(𝑥) + tan(𝑥) − 𝑎𝑏𝑠(𝑎) Види вбудованих функцій : InputBox використовується для введення даних InputBox (Підказка [, Заголовок вікна ]) MsgBox використовується для виведення повідомлень MsgBox(Повідомлення, Кнопки + Значок, Заголовок) Str Перетворює числове значення в символьне Str (число) a=”12” b=”10” Print a+b 1210 Print Val(a)+val(b) 22 Val Перетворює символьний рядок в числове значення Val(символьний рядок) ХІД РОБОТИ: Завдання №1: Створити форму з назвою «Обчислення », на який можна змоделювати обчислення виразу: 𝑑 = 𝑎 𝑏 + √𝑐 1. Завантажте середовище Visual Basic(Пуск/Все программы Visual Basic ) 2. Вставте у форму п’ять об’єктів типу Label (як показано на мал.). 3. Вставте у форму поле редагування - об’єкт TextBox. Для цього клацнуть на піктограмі об’єкти типу Text Box. 4. Вставте у форму кнопку – об’єкт типу Command Button (як показано на мал.). Введіть назву кнопки – Обчислення виразу 1. Label 1 Label 2 Label 3 Label 4 TextBox 1 TextBox 2 TextBox 3 Label 5 Command Button 1
  • 3. 5. Змініть назву з Label 1, Label 2, Label 3, Label 4. Використати властивість – Caption).. Label 5 – залишити без назви. 6. Змініть назву форми з Form1 на «Обчислення”.(Використати властивість – Caption). 7. Запрограмуйте кнопку „Обчислити значення виразу”. Завдання №2. Доопрацюйте форму «Обчислення » таким чином, щоб введення даних здійснювалися за допомогою функції InputBox, а виведення – MsgBox. На форму вставте кнопку Command Button, перейменуйте - Обчислення виразу 2. Запрограмуйте кнопку по зразку: Завдання для самостійного виконання: Спеціальність ТОРО Визначити контактне напруження в поверхневому шарі зубців шестеренної кліті за формулою: 𝐺𝑘 = 240 𝑎𝑤 √ 𝑀𝑝(𝑢+1)3 𝑏∙4 МПа (1), де Мр=500106 Н*мм; U=1; b=830 мм; aw=500 мм. Перевірка результату: Gk=1331 Спеціальність ОМТ Початкова товщина штаби h0=15мм; кінцева товщина h1=10 мм; діаметр валків D=550мм. Розрахувати кут захоплення в радіанах. Формула обчислення абсолютного обтиску ∆ℎ = ℎ0 − ℎ1 (1), Формула обчислення кута захоплення в радіанах 𝛼 = √ ∆ℎ 𝑅 = √ 2(ℎ0−ℎ1) 𝐷 (2) Перевірка результату: h = 5, =0.135 Спеціальність ЗВ Визначте силу зварювального струму Ізв, діаметр зварювального дроту de, напругу на дузі Ug. Відомо, що коефіцієнт пропорційності - Кn=1.1; товщина металу, що зварюється - S=6 мм, h - глибина проплавлення - h=0.8- S (мм); Дані для перевірки a 4 b 2 c 9 d 5
  • 4. n зв K h I 100   , А (1) i I d зв е 13 . 1  , мм (2) де і-допустима щільність струму, А/мм2 і=30 ел зв d I Ug    06 . 0 25 , В (4) Перевірка результату: I zv = 436.36, de=4.31, Ug = 1.88 Спеціальність ВПМ Визначити критерій Рейнольдца для руху рідини в трубопроводі, який має в січенні круг діаметром d=0,08м., витрати рідини V=5 м3 /год, коефіцієнт динамічної в’язкості =0,39610-3 Н∙с м𝟐 , густина рідини =785кг/м3 . 𝑹𝒆 = 𝝎∙𝒅∙𝝆 𝝁 (1) V=S (2) S – площа поперечного перерізу каналу, м2 𝑆 = 𝝅∙𝒅𝟐 𝟒 (3) 𝝎 = 𝑽 𝑺 ∗ 𝟑𝟔𝟎𝟎 (4) Перевірка результату: Re = 43841.190 КОНТРОЛЬНІ ЗАПИТАННЯ: 1. Призначення об’єкту TextBox. 2. Дати визначення змінної, константи. 3. Яким чином здійснюється опис змінних, констант в середовищі Visual Basic? 4. Які величини називають операндами: 5. Які типи даних вам відомі? 6. Які вмонтовані функції дають цілий, дійсний результат? 7. Які вбудовані функції для введення та виведення даних вам відомі? Правила їх застосування. 8. Виконати обчислення Fic(20.7)+Fic(141.89)-Fic(-15.7)+Round(3.25,1)-Round(6.891,2)+Round(- 3.472,1)+15 mod2 -152; 9. Записати математичні вирази мовою програмування: 𝑏3 + 𝑐4 ∗ 3𝑑 (5 + 𝑎) ; |𝑎3 + 𝑏| − 𝑡𝑔𝑥 + 𝑠𝑖𝑛𝑥; 𝑠𝑖𝑛 √2 + 𝑥 2𝑥 10* Намалювати блок схему до самостійного завдання.