Sunteți pe pagina 1din 2

COMPUTER III FOURTH PERIODICAL TEST Lesson 1: Using Controls with Conditional Statements Conditional Statements involve the

the rational operators (>, <, >=, <=, =, etc.) that could be either TRUE or FALSE results It also involves logical operators (AND, OR, NOT)

Nested If Statement used to check more than 1 condition. Structure: If <condition> Then <statement> ElseIf <condition> Then <statement> Else <statement> End If Select Case Structure It is the same with the if structure that is used for decision making It provides choices which are known as selector. Structure: Select Case Selector Case Value Action to be Executed Case Value Action to be Executed Case Else Action of last End Select Lesson 2: Message and Input Box

Logical Operators AND If both/all statements are True, then the result is True OR When either or any of the expressions is True, then the result is True NOT If the expression is True, then the result is opposite of the expression. Logical AND Truth Table X False False True True Logical OR Truth Table X False False True True

Y False True False True

Z=X*Y FALSE FALSE FALSE TRUE

Y False True False True

Z=X+Y FALSE TRUE TRUE TRUE

Function accepts arguments and returns a single value Argument is a value passed to a function so the function has data to work with

If Then Statement Performs an indicated action only when the condition is TRUE. Structure: If <condition> Then <statement> End If If Then Else Statement If block statement is used to check whether statement is TRUE OR FALSE. Structure: If <condition> Then <statement> Else <statement> End If

Dialog Boxes These are special windows which are used by computer programs or by the operating system to display information to the user, or to get a response if needed. It is used to exchange information between the program and the user. MODAL - These are used when the user needs to respond to some prompt or message before continuing with the program. NONMODAL - These are simply forms that are displayed and can be left open. Message Box It is a box or small window that appears on the screen and presents a message from the program being used. Format: Msgbox Prompt, Buttons & Icons, Title

Arguments for a Message Box Prompt the message or information displayed on the message box Buttons & Icons allows you to insert the appropriate buttons and icons Title the message box title that appears on its title bar vbOkOnly vbOkCancel vbAbortRetryIgnore vbYesNoCancel vbYesNo vbRetryCancel vbCritical vbQuestion vbExclamation vbInformation vbSystemmodal 0 1 2 3 4 5 16 32 48 64 4096 Ok button Ok and Cancel button Abort, Retry and Ignore button Yes, No and Cancel button Yes and No button Retry and Cancel button Critical Message icon Query icon Warning icon Information icon System icon

Lesson 3: Variables temporary named storage areas programs memory that will hold data inserted as code statements inside the

Scope of Variables Local Variable declared inside the event declaration & only recognized in the procedure where it is declared Dim Statement used to declare variables Format: Dim VarName as DataType Example: Dim Age as Integer Implicit Declaration declaration of variables inside a procedure Explicit Declaration declaration of variables outside a procedure Lesson 4: Looping Repetition structure allows the user to do the same action of program until the given condition is true Iteration repetition of loops Accumulator temporary storage location that holds values during a process Counter a temporary storage location that counts the number of iteration/process in a program

Input Box It creates a modal dialog box that can be used to retrieve one piece of information from a user. Format: InputBox Prompt, Title, Default Arguments for an Input Box Prompt displays the message or desired information Title specifies the window title shown at its title bar Default allows you to display a standard or automatic entry that appears in the input text box

Do Loops A loop is a statement used in most programming languages to repeat a sequence of procedure as long as the condition becomes true It uses the keywords while or until followed by the word do or loop Do WhileLoop Statement (looks for the TRUE value) used to execute statements until a specified condition is met Structure: Do While <condition> <statement> Loop Do UntilLoop Statement (looks for the FALSE value) procedure is executed as long as the loop test evaluates a false value Structure: Do Until <condition> <statement> Loop

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