Sunteți pe pagina 1din 15

John Nelson A.

VISUAL BASIC 2015 Picones


Visual Basic is an object oriented computer
programming language implemented on the
.NET frame

VISUAL BASIC
VB Control Prefix
Check box chk
Combo box cbo
Button btn
Form frm
Group box grp
Label lbl
List box lst
Masked text box msk
Radio button rdb
Picture box pic
Tab control tab
Text box txt
Timer tmr
Variable, Constants,
and Data Types
- Is a memory location that
Variable computer uses to store
data
Begin with English Reserved words or code
Naming alphabet must not be used as
variable name

your
Variable

Must not exceed Spacing is


255 characters invalid
5. The only allowed symbol in variable

6. The whole word for dim.

Identify the
following 7.The capacity of a variable name.

statement
8. Variable that are fixed and cannot be
altered by the program.

9. The data type that is higher capacity


than integer.
Dim TaxDue As
Currency

You can use Dim statement


to associate variables with
Dim HomeAdd As
specific data types. String

Ex. Dim Age As Single

Dim Discount as
Single

Dim Ratio as
Double
Double is for fractional
numbers and Integer is for
whole numbers. String is
combination of alpha numeric
and symbols.

Data Types
There are some numbers that
has no value in nature. Meaning
no sense to be compared nor
use for computation. Therefore,
must use string.
Constant

- Setting value for certain data of the


program. This value cannot and should
not be altered by the program.
Data Type Example
Integer 32 766
Data Single 0.0005
Types in
Visual Double 0.00000000005
Basic
String Hello Grade 9
Boolean True/False
Date 12-1-2016
Data Type Suffix Example (second line
is constant)

Integer % Dim z%
Dim z%=3275

Variable Long & Dim z&


Dim population&=3275
Suffixes Single ! Dim coins!
Dim num!=0.0005
in Visual # Dim quad#
Double
Basic Dim ratio#=0.0005

Currency @ Dim wage@


Dim pera@=10.25

String $ Dim schoolName$


Dim Greet$=“Hello To”
Activity: ½ 1. Dim end as boolean
Lengthwise 2. Dim num% as Integer
Identify if the 3. Dim abc$
given is Valid or abc$=“hello 9”
Invalid and 4. Dim Ave-Score as Double
explain it. 5. Dim PhP@
Note: to be pesoValue@=
submitted on 14.45
Tuesday.
Identify the
CHOICES data type of
the following
INT, DOUBLE, variables.
(copy and
CONST, answer) And
write the dim
STRING codes as a
whole
1. Number of days in 14. GWA
a week 15. Voucher price
2. Street number 16. Starbucks points
3. Area of square 17. Number of week in
4. Page number a year
Choices 5. Yr and Section 18. Teacher to student
ratio
INT, DOUBLE, 6. Cellphone number
7. Year level 19. Date
CONST, 8. Name of character 20. Subject code

STRING 9. Total gold coins


10. Level in the game
11. Price of product
12. Software version
number
13. Quiz raw score

S-ar putea să vă placă și