Computer 2nd QA Reviewer
Computer 2nd QA Reviewer
DATA MANAGEMENT
Variables
the areas allocated by the computer memory to hold the data
Camel Case Notation: easier and quicker to type than other notations and is the practice
of writing compound words or phrases in which words are joined without spaces and are
capitalized within the compound, thus, looking like humps of a camel.
It’s the general term for using lowercase letters except for the starting letter of a syllable
myName
totalAmount
manufacturedDate
Syntax:
If condition Then
Executable statement
ElseIf
Executable statement
Else
Executable statement
End If
Calling code – a statement or an expression within a statement that specifies the procedure by
name and transfers the control to it
When naming a Procedure,
- it must begin with a letter
- shouldn’t have periods, mathematical, or comparison operators
- should be unique and not have a same name
Example:
Sub Assign ()
Dim strFullName As String
srtFullName = “Paul Cruz”
MessageBox.Show (strFullName)
End Sub
Public Sub Main ()
Call Assign ()
End Sub
Mathematical Functions
very useful and important in programming especially when dealing with mathematical concepts
in programming.
o Abs function returns the absolute value of a given number
Syntax: Math.Abs(Number)
o Exp function returns the exponential value of a given number
Syntax: Math.Exp(Number)
o Log function returns the natural logarithm of a number
Syntax: Math.Log(Number)
o Fix shortens the decimal part of a positive number and returns the largest integer smaller
than the number, but when the number’s negative, it returns the smallest integer larger than
the number
Syntax: Fix(number)
o Rnd function is used to write code that involves chance and probability, and returns a
random value between 0 and 1
Syntax: VBMath.Rnd()*Number
o Round function rounds up a number to a certain number of decimal place
Syntax: Math.Round(number, m)
o Sqrt returns the square root of a number
Syntax: Math.Sqrt(Number)
Date Functions
reads the system clock and returns the current date as a string in the format MM/DD/YY
1. Now# function returns a date value containing the current date and time according to the
system setting.
Syntax: [variable | control] = Now ()
2. Today# function returns a date value containing current date only
Syntax: [variable | control] = Today ()
3. TimeOfDay# function returns the date value containing current time only
Syntax: [variable | control] = TimeOfDay ()
Input and Output Functions
allows the system to handle input from the user and output that is resulted from the code
InputBox function displays a message box, where user can input data
Variable = InputBox (Prompt, Title, default_text, x-position, y-position)
o Prompt: message displayed prompting what is to be entered
o Title: the title of the input box
o Default-text: the default text that appears inside the input box
o X-position and Y-position: the position of the coordinates of the input box
Example:
Dim anum As String
Anum = InputBox (“What is your name?”, “Type here”, name, 500, 500)
MsgBox function produces a pop-up message box and prompts the user to click on a
command button before going to the next instruction
Variable = MsgBox (Prompt, Style Value, Title)
o Prompt: Message displayed in the message box
o Style Value: These are command buttons that will appear on the message box
o Title: The title of the message box