- Logical operators
This operator compares two variables. For instance, If male, take A(adult) B(child)
This operator output events that are exclusively of one type. For example, If NOT true print 1, otherwise print 0
This operator outputs events that are either of condition A or condition B. For instance,
Output X if between 0-50 OR 51-100
- Boolean variables are numerical variables with a single binary digit used to hold integer value 0 or 1.True is represented by 1 and false is represented by 0
- ConditionA and ConditionB.
It means that the output variables have condition A and condition B. Boolean AND narrows the search to include only documents that contain every one of the keywords entered
- ConditionA or ConditionB
Implies that the output is either of condition A or of condition B
- NOT ConditionA excludes all the variables with condition A
- Boolean data types are used to represent logical values. They are normally represented by “no” or “yes” in code. In VB they are used to contain True or False values where True or False correspond to two states of the Boolean variables. When VB converts numeric data types to Boolean, 0 becomes False and the other values becomes True. When the opposite happens, False becomes 0 and True becomes -1.
A local variable is a variable that is given local scope. An element declared within a procedure is unavailable outside that procedure and only the procedure that contains the declaration can use it. Thus variables at this level are known as local variables. They are declared with the Dim statement. Local variables are only visible in the method or block they are used. They cannot be accessed from outside because their names are known only within the method. Class level variables are in a class but outside a method and must be declared static. They can be seen by all methods in the class but are often displayed public to avail constants to the user. They are qualified with the class name.
When calling a function, a chunk of memory of the actual parameters value is passed on and a content of the actual parameter is copied. Pass by value is defined as making a copy in memory of the actual parameter’s value that is passed on. Passing by value is used when using the parameter for some computation but not when changing the client program. An example of passing by value is printing a page and handing you the printout. The printout is the disconnected copy of the original.
- Top-down design is a method of breaking a problem into smaller sub-problems which in turn are broken down further into smaller sub-problems, continuing until each sub-problem can be conclusively solved using small steps. Using the principle of stepwise refinement, the general problem is defined after which it is broken down into small successive steps until l the whole program is fully defined. Top-down design simplifies a big problem into sub problems at the lower level that can easily be solved.
- Do while is the most appropriate loop for counting odd numbers from one to hundred. This is because in the 1-100 not all numbers are odd numbers thus, it will stop when the list of odd numbers is exhausted.
- Infinite loops repeat indefinitely until an Exit Do is encountered . They occur if no condition is specified
For.Next loop is favorable in this case. The file is read from the start with the value of pages incremented with each iteration of the loop until the end of the file is reached.