conditional-statement.ICT10.Programing language

danandreydelrosario 7 views 50 slides Oct 01, 2024
Slide 1
Slide 1 of 50
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50

About This Presentation

Ict


Slide Content

Visual Basic Programming 6.0 Fernan S. Garcia ICT-10 Teacher September 30 , 2024-Date of Teaching

Evaluate the following expressions as True or False . 1. 65 < 56 2. Not (23 > 14) 3. -1 =< 0 4. 4 >= (-4) And 2^2 = 4 5. 23 > 14 Or 8 > 11 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) 3. -1 =< 0 4. 4 >= (-4) And 2^2 = 4 5. 23 > 14 Or 8 > 11 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) False 3. -1 =< 0 4. 4 >= (-4) And 2^2 = 4 5. 23 > 14 Or 8 > 11 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) False 3. -1 =< 0 True 4. 4 >= (-4) And 2^2 = 4 5. 23 > 14 Or 8 > 11 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) False 3. -1 =< 0 True 4. 4 >= (-4) And 2^2 = 4 True 5. 23 > 14 Or 8 > 11 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) False 3. -1 =< 0 True 4. 4 >= (-4) And 2^2 = 4 True 5. 23 > 14 Or 8 > 11 True 6. 10-8 + 9 <= 2^3 + 2 Recall

Evaluate the following expressions as True or False . 1. 65 < 56 False 2. Not (23 > 14) False 3. -1 =< 0 True 4. 4 >= (-4) And 2^2 = 4 True 5. 23 > 14 Or 8 > 11 True 6. 10-8 + 9 <= 2^3 + 2 False Recall

Learning Competencies:

Learning Competencies: discuss the different structure of conditional statements;

Learning Competencies: discuss the different structure of conditional statements; determine the difference of the structure of the different conditional statements; and

Learning Competencies: discuss the different structure of conditional statements; determine the difference of the structure of the different conditional statements; and write the code of the program involving conditional statements.

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 1:

Activity 2:

The extra challenge is to create a new sentence using the end of the previous one. The first member of the group begins with a sentence, for example with first condition: “If I go out tomorrow, “I’ll go to the beach”. The next member of the group relay must then use the end of the previous sentence. “If I’ll go the beach, “I’ll sunbathe …If I’ll get burnt…If I get burnt, I’ll go to the pharmacy…Bear in mind that the members can include modals such as “might” and “could” in the pattern too. Activity 2:

Mechanics: Divide the class in a group consisting 5-6 members. Give each group a piece of paper. Decide what conditional structure will be used. The first member of the group will write a sentence in that structure at the top of the paper. They the paper is pass to the next member of the group. Activity 2:

Mechanics: 1. Divide the class in a group consisting 5-6 members. 2. Give each group a piece of paper. 3. Decide what conditional structure will be used. 4. The first member of the group will write a sentence in that structure at the top of the paper. 5. Then the paper is pass to the next member of the group. Activity 2:

6. Each member must then write a second conditional statement which follows the previous one. In other words, they would use the second part of the previous sentence as the first part of the next one. 7. After each sentence is written, the student must fold over the piece of paper so that only one sentence is showing, the student is only able to see the previous sentence. 8. The process is done until the paper returns back to the first student. 9. The group can then unfold the paper and read out their conditional chain statement. Activity 2:

Based on the Activities 1 and 2? 1. What these two activities are all about? 2. What is common concept to both activities?

Conditional Statement

Conditional Statement It tells a program to execute an action depending on whether a condition is TRUE or FALSE . It is often represented as an if-then or if-then-else statement .

Conditional Statement IF Then Statement - A structure which performs an indicated action only when the condition is TRUE .

Conditional Statement IF Then Statement - A structure which performs an indicated action only when the condition is TRUE . Syntax: If (condition/logical test) = True Then ( Action to be taken/Statement to be executed ) End If

Conditional Statement IF Then Statement - A structure which performs an indicated action only when the condition is TRUE . Syntax: If (condition/logical test) = True Then ( Action to be taken/Statement to be executed ) End If TRUE

Conditional Statement IF Then Else Statement - A structure which check whether the condition or logical test is TRUE or FALSE . It will take the course of action based on the retrieved on the logical test. Syntax : If (condition/logical test) = True Then ( Action to be taken/Statement1 to be executed Else ( Action to be taken/Statement2 to be executed End If

Conditional Statement IF Then Else Statement - A structure which check whether the condition or logical test is TRUE or FALSE . It will take the course of action based on the retrieved on the logical test Syntax : If (condition/logical test) = True Then ( Action to be taken/Statement1 to be executed Else ( Action to be taken/Statement2 to be executed End If TRUE

Conditional Statement IF Then Else Statement - A structure which check whether the condition or logical test is TRUE or FALSE . It will take the course of action based on the retrieved on the logical test Syntax : If (condition/logical test) = True Then ( Action to be taken/Statement1 to be executed Else ( Action to be taken/Statement2 to be executed End If TRUE FALSE

Conditional Statement Sample Problem: Write the code of a program that will evaluate an age and then display “You are qualified to vote” if the age is 18 and above else display “ You are not qualified to vote”

Conditional Statement 1. What are the two conditional statements which are used in Visual B asic programming? 2. What are the differences between the two conditional statements in a program?

Conditional Statement IF Then Statement - A structure which performs an indicated action only when the condition is TRUE . IF Then Else Statement - A structure which check whether the condition or logical test is TRUE or FALSE .

Activity 3A: What’s the code? Sample Problem: Write the code of a program that will evaluate a grade and then display if the grade is “PASSED” or “FAILED”. The passing grade is 75.

Think of the Condition! Why is it important to have a wise decision in every situation and conditions in our daily lives?

Think of the Condition! Why is it important to have a wise decision in every situation and conditions in our daily lives ? -Making better decisions in life leads to better results and outcomes.

Any Question?

EVALUATION: Activity 3A: What’s the code? EVALUATION: Groups 1-3 Problem # 1. Write the code of the interface below that will allow the user to enter the password. If the password is equal to “ turacnhs ” then label displays “Access Granted” , else, it displays “Try Again” once the command button is clicked.

EVALUATION: Activity 3A: What’s the code? Groups 4-6 Problem # 2. Write the code of the interface below that will allow the user to enter a number. If the number is greater than or equal to zero then label displays “The number is positive”, else, it displays “The number is negative” once the command button is clicked.

Class, did you understand the lesson?

THANK YOU FOR LISTENING! BASIC !

Extend/Assignment Design a template and write the code of the program that will display “The first number is greater than the second number” or “The second number is greater than the first number” once the command button is clicked.