danandreydelrosario
7 views
50 slides
Oct 01, 2024
Slide 1 of 50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
About This Presentation
Ict
Size: 320.58 KB
Language: en
Added: Oct 01, 2024
Slides: 50 pages
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.