Shared Flashcard Set

Details

Computer Science Exam 2
Notes for Exam 2
20
Computer Science
Undergraduate 2
10/19/2009

Additional Computer Science Flashcards

 


 

Cards

Term

 

 

Condition

 

Definition
An expression involving relational operators (<, =) that is either true or false.
Term

 

 

If Block

 

Definition

Decisions based on conditions:

 

If (condition) Then

action 1 

Else

action 2   (or error message)

 

Term

 

 

Select Case Block

Definition

Decision of One Variabl

Select Case Shapes

     Case "Circle"

          number = 1

     Case "Square"

         number = 2

Term

 

 

Select Case with numbers

Definition

Select Case totalsales

Case Is <= 400

     tax = 400 * .05

Case Is <= 500

    tax = 500 * .05 + 2

Term

 

 

Relational Operators

Definition

 

 

<, >, =, <>, <=, >=, 

Term

 

 

Principal Logical Operators

Definition

 

 

And, Or, Not

Term

 

 

Boolean Data Type

Definition

 

Any variable or expression that evaluates to either true or false. 

Term

 

 

Sub Procedure

Definition

 

 

A part of a program that performs one of more related tasks, has its own name, and is written as a separate part of the program.  

Term

 

 

Sub procedure example

Definition

Call CalculateDensity("Hawaii, 1263244)

 

Sub CalculateDensity(ByVal state As String, ByVal pop As Double....)

 

End Sub

Term

 

 

Modular or Top-Down Design

Definition

Using sub procedures to break down big problems, and focus on the main program.

 

Term

 

 

By Value

Definition

ByVal:

 

when a variable is passed to a parameter so that it receives only a copy.

Term

 

 

ByReference

Definition

ByRef:

 

When a variable is passed by reference as in the parameter sends a location and only has a "thread" to the call statement it corresponds with.

Term

 

 

Function Procedures

 

Definition

User-defined functions

A general procedure that returns a single value.  

Term

 

 

Example of Function

Definition

Function CalcRectangle(ByVal length As Double, ByVal width As Double)

 

Return length * width

 

End Function

 

Term

 

Arguments and Parameters

Definition

In any procedure, the arguments in the calling statement must match the parameters in the procedure in number, type and order.  They do not need to match in name. 

Term

 

 

Substring

Definition

.Substring returns a word or letters

 

"fanatic".Substring(0,3)  is "fan"

 

Term

 

IndexOf

Definition

IndexOf returns a position number

 

"fanatic".IndexOf("ati")  is 3

Term

 

 

Example of Zones

Definition

Dim fmtZone As String = "{0,-10}{1,12}"

lstResults.Items.Add(String.Format(fmtZone, "College", "City", "Students")

lstResults.Items.Add(String.Format(fmtZone, "Mizzou", "Columbia", 15000)

Supporting users have an ad free experience!