Writing Software
Writing Software
Programming Language
is anything capable of
making a decision
ALGORITHM
step-by-step description of how the
problem is going to be solved.
list or “Is 10 greater than 4?”
diagram no o r
or e
u e r 0
es t r s 1 o
y fa l
Programming Structure
VB code is stored in modules. The three
kinds of modules are:
1.Form- is the most common kind with a
file name extension .FRM
2. Standard- is used for modules
shared by other modules with a file
name extension .BAS
. Class –is used for user-defined objects wit
a file extension .CLS
Grading sheet.xlsx
Writing the code: The code must be entered
between Private Sub........End Sub.
(Refer to page 169)
3 components of a variable:
1. Data type –number, string, date
2. Name – to distinguish from one
another
3. Value – information stored in the
variable
Naming Variables
Variable
ASSIGNING VALUES TO VARIABLES
After declaring various variables using
the DIM Statements, you can assign
values to those variables.
The general format of an
assignment is:
Variable = Expression
The variable can be declared
variable or a control property
value. The expression could be
mathematical expression, a
number, a string, a Boolean value
(true or false), etc.
The following are some examples: Assigning Values to Variables\Assigni
ng Values to Variables.sln
Variable=Expression
firstNumber=100
secondNumber=firstNumber-99
username=”Agnes Marie”
userpass.Text=password
Label1.Visible=True
Command1.Visible=false
ThirdNumber=Val (userum1.Text)
Total=firstNumber+secondNumber+ThirdNumber
If there is computation, start Dim
declaration
What is Constant?
a representation of data that remains the
me throughout the program.