Lesson 5 Introduction to Human Computer Interaction

EllenGracePorras 25 views 32 slides Jul 10, 2024
Slide 1
Slide 1 of 32
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

About This Presentation

Lesson 5 Introduction to Human Computer Interaction


Slide Content

Introduction to HCI Instructor: Ellen Grace Porras

Visual Basic.Net 2 Elements Design Variables Dimension Data Types

Elements 3 Button Message Box Textbox Radio Button Checkbox

Button with Math Functions Syntax: ADDITION MessageBox.Show (10 + 5) 4 ADDITION

Syntax: SUBTRACTION MessageBox.Show (10 - 5) 5 Button with Math Functions SUBTRACTION

Syntax: MULTIPLICATION MessageBox.Show (10 * 5) 6 Button with Math Functions MULTIPLICATION

Syntax: DIVISION MessageBox.Show (10 / 5) 7 Button with Math Functions DIVISION

Text Box + Button Math Functions Syntax: Textbox1.text = 10+3 Textbox1.text = 10-3 Textbox1.text = 10*3 Textbox1.text = 10/3 8 ADDITION Answer: SUBTRACTION MULTIPLICATION DIVISION

Two Text Boxes + Button +Messagebox Math Functions Syntax: Addition MessageBox.Show(Textbox1.Text ++ Textbox2.Text) 9 ADDITION 10 First Number: SUBTRACTION MULTIPLICATION DIVISION Second Number: 5 Message Box //Answer here 15

Two Text Boxes + Button +Messagebox Math Functions Syntax: Addition MessageBox.Show(Textbox1.Text - Textbox2.Text) 10 ADDITION 10 First Number: SUBTRACTION MULTIPLICATION DIVISION Second Number: 5 Message Box //Answer here 10

Two Text Boxes + Button +Messagebox Math Functions Syntax: Addition MessageBox.Show(Textbox1.Text * Textbox2.Text) 11 ADDITION 10 First Number: SUBTRACTION MULTIPLICATION DIVISION Second Number: 5 Message Box //Answer here 50

Two Text Boxes + Button +Messagebox Math Functions Syntax: Addition MessageBox.Show(Textbox1.Text / Textbox2.Text) 12 ADDITION 10 First Number: SUBTRACTION MULTIPLICATION DIVISION Second Number: 5 Message Box //Answer here 2

Two Text Boxes + Button and Textbox Math Functions Syntax: Addition: Textbox3.text = Textbox1.Text ++ Textbox2.Text Subtraction: Textbox3.text = Textbox1.Text - Textbox2.Text Multiplication: Textbox3.text = Textbox1.Text * Textbox2.Text Division: Textbox3.text = Textbox1.Text / Textbox2.Text 13 ADDITION 10 First Number: SUBTRACTION MULTIPLICATION DIVISION Second Number: 5 15 Answer:

14 Data types determine the type of data that any variable can store. Variables belonging to different data types are allocated different amounts of space in the memory. There are various data types in VB.NET. They include: Boolean : Its value can be either True or False. Char : Single character Date : Date values Integer : Whole numbers String : Text values What are Data Types?

Variables 15

16 Dim

Declare a variable Mymessage as a string with a value “Hello BSIT 2nd Year” Dim Mymessage As String = "Hello BSIT 2nd Year!” MessageBox.Show ( Mymessage ) //Or Dim Mymessage As String = "Hello BSIT 2nd Year!” Textbox1.Text = Mymessage 17 Example: String

Example: Integer Declare a variable Mynumber as integer with a value of 10. Show the output using MessageBox . Dim Mynumber As Ingteger = 10 MessageBox.Show ( Mynumber ) //or this Dim Mynumber As Ingteger = 10 TextBox1.Text = Mynumber 18

Example: String and Integer Declare a variable Mynumber as integer with a value of 10 and Mymessage as string with a value of “Hello”. Show the output using MessageBox . Dim Mynumber As Ingteger = 10 Dim Mymessage As String = “Hello” MessageBox.Show ( Mymessage & Mynumber ) 19

Check your knowledge Display “Good Morning!” using a MessageBox Display “Information Technology” using TextBox3 Declare the variables firstname , lastname as string. Display the fullname using textbox2. 20

Let’s check your Knowledge Declare a variable firstname , lastname and fullname as String. Combine all the variables to show the FULLNAME on a Messagebox. 21 Your Full name is FULL NAME Enter First name: Ellen Grace Porras Enter last name: Message Box Your full name is: Ellen Grace Porras

Let’s check your Knowledge Declare a variable firstname , lastname and fullname as String. Combine all the variables to show the FULLNAME on a Messagebox. 22 Your Full name is FULL NAME Enter First name: Ellen Grace Porras Enter last name: Message Box Ellen Grace Porras

Let’s check your Knowledge Declare a variable firstname , lastname and fullname as String. Combine all the variable to show the FULL NAME on a Messagebox. Dim firstname , lastname , fullname As String firstname =Textbox1.Text lastname = Textbox2. Text fullname = Textbox1. Text + “ ” + Textbox2.Text Messagebox.Show ( “Your full name is: “ + fullname ) 23

Let’s try with math functions Declare a variable num1, num2 and answer as integer. Show the output using MessageBox . Dim num1, num2, answer As Ingteger num1=5 num2 =10 answer =num1+num2 MessageBox.Show(answer) 24

Let’s try with math functions Declare a variable num1, num2 and answer as integer. Show the output using MessageBox . Dim num1, num2, answer As Ingteger num1=Textbox1.Text num2 = Textbox1.Text answer =num1+num2 MessageBox.Show(answer) 25

Let’s try with math functions Declare a variable num1, num2 and answer as integer. Show the output using Textbox. Dim num1, num2, answer As Ingteger num1=Textbox1.Text num2 = Textbox2.Text answer =num1+num2 Textbox3.text = answer Textbox1.Clear Textbox2.Clear 26

Activity 1: Convert ft to cm Design: Text Box and Button 27 Convert CONVERTER (ft to cm) Enter ft: Answer:

Activity 1: Convert ft to cm Dim ft, answer As Ingteger ft=Textbox1.Text answer =ft*30.48 Textbox2.Text = answer 28 Convert CONVERTER (ft to cm) Enter ft: Answer:

Activity 2: Get the area of a Rectangle Design: Text Box and Button 29 Compute Area of a Rectangle Length: Width: Area:

Activity 2: Get the area of a Rectangle Dim lngth , wid,area As Ingteger lngth =Textbox1.Text wid =Textbox2.Text area = lngth * wid Textbox3.Text = area 30 Compute Area of a Rectangle Length: Width: Area:

ASSIGNMENT Declare variables for username and password as string Given: Username=“Admin” Password=“Pass123” Conditions: If the user entered correct username and password on textbox1 and textbox2, print on a messagebox “Welcome to Visual Basic” If the user entered incorrect username on textbox1, print on a messagebox “incorrect username” If the user entered incorrect password on textbox2, print on a messagebox “incorrect password” 31 LOG IN LOG IN FORM USERNAME: PASSWORD:

Thank you Presenter name: Ellen Grace D. Porras Email address: [email protected]
Tags