Lesson Plan Visual Basic

Only available on StudyMode
  • Topic: Switch statement, Conditional, Imperative programming
  • Pages : 7 (1009 words )
  • Download(s) : 299
  • Published : May 13, 2013
Open Document
Text Preview
Technological University of the Philippines
College of Industrial Education
Student Teaching Department
Ayala Boulevard Ermita, Manila

Teacher: Buladaco, Jemaima M. Time: 7:00 – 10:00 AM Course: BSIE-ComEd Date: March 13, 2013
Cooperating Teacher: Mr. Alvin Quileste Supervisor: Prof. Valentino Angeles

I. OBJECTIVES
At the end of the lesson, the students are expected to:
1. Extend the nested if-then-else conditional statement in making simple animation using Visual Basic 6.0 2. Perform simple animation using the nested if-then-else conditional statement in Visual Basic 6.0 3. Appreciate the essence of nested if-then-else conditional statement in making animation in Visual Basic 6.0 II. SUBJECT MATTER

Topic: The Nested If-Then-Else Statement in VB 6.0
Sub-topic: Making Simple Animation Using VB 6.0
Materials Needed:
Whiteboard Marker
Whiteboard
LCD Projector
Laptop (Computer)
Visual Aids
Pointer
Reference(s):
Understanding Structured Programming by Penaflorida, Vizcarra and Fernandez www.google.com
www.youtube.com
III. PREPARATION
A. Preparation
1. Daily Routine
2.1 Prayer
2.2 Greetings
2.3 Checking of Attendance
2.4 Checking of Assignments
2. Recall of past lesson
-Teacher will call at least two to three students to recall the past lesson.

B. Presentation
B.1. Motivation
“HangAroo” Game

* The students gives a letter corresponds to the answers

B.2. Definition of Terms

Animation - is the rapid display of a sequence of images to create an illusion of movement. Boolean Expression - A Boolean expression is an expression that evaluates to a value of the Boolean Data Type: True or False.

B.3. Lesson Proper

HOW TO MAKE A SIMPLE ANIMATION USING NESTED IF-THEN-ELSE STATEMENT IN VISUAL BASIC 6.0

First, let us review what nested if-then-else statement in Visual Basic is.

Nested If...Then...Else selection structures test for multiple cases having with two or more conditions.

The syntax for that is:

If < condition 1 > Then
statements
ElseIf < condition 2 > Then
statements
ElseIf < condition 3 > Then
statements
Else
Statements
End If

Example for nested if-then-else statement is:

If average > 75 Then
txtGrade.Text = "A"
ElseIf average > 65 Then
txtGrade.Text = "B"
ElseIf average > 55 Then
txtGrade.text = "C"
ElseIf average > 45 Then
txtGrade.Text = "S"
Else
txtGrade.Text = "F"
End If

How to make a simple animation using nested if-then-else statement

1. Set the properties of the form: three (3) picture boxes

Figure 1: In the form, there are three (3) picture boxes inserted

2. Set the properties of the form: one (1) timer

Figure 2: In the form, there are three (3) picture boxes inserted together with the timer

3. In the three picture boxes, put the image that you want to insert in the three picture boxes. To put that, click on the picture box - click the button in the properties window. It is also the same with the two remaining picture boxes.

Figure 3: The Picture Function import images

Figure 4: The images that being use to the animation are already import.

4. Double-click on the form. This will be appear:

`

5. Type the code for the form:

Private Sub Form_Load()
Picture1.Visible = True
Picture2.Visible = False
Picture3.Visible = False
Timer1.Enabled = True
Timer1.Interval = 170
End Sub

6. Click on the timer icon in the form. This will be appear:

7. Type the code below the Private Sub Timer1_Timer ()

Private Sub Timer1_Timer()
If Picture1.Visible = True Then
Picture1.Visible = False
Picture2.Visible = True

ElseIf Picture2.Visible = True Then
Picture2.Visible = False
Picture3.Visible = True

ElseIf Picture3.Visible = True Then
Picture3.Visible = False
Picture1.Visible = True

End If...
tracking img