test 2 Flashcards
for each loop array
static void Main( )
{
int[] fibarray = new int[] { 0, 1, 2, 3, 5, 8, 13 };
foreach (int i in fibarray) { Console.WriteLine(i); } }
class
a program construct used to represent an entity type in the real world… used as a templit to create objects… classes contain both data and procedural information
object
an instance of a class… reps a real-world occurrence of an entity
attribute
characteristic of a class. In-line attributes are ones that are declared within the class Associated attributes are contained in another class.
Method
procedure that applies to the data in a class.
Inheritance
a class association that allows the attributes and methods of a parent class to be available to the child classes.
class visibility modifiers
Public (+)
Protected (#)
Package (~)
Private (-)
static
means that the class component is associated with the class
UML Class Diagrams
Class name – Starts with capital, camel case thereafter.
Attributes – Characteristics of the class (i.e., variables and constants).
Methods – Behaviors of the class (i.e., procedures).
Inheritance links – Associations between classes
CASE Selection Structure
SELECT CASE light-color CASE “red” Print “stop light” CASE “yellow” Print “caution light” CASE “green” Print “go light” CASE Else Print “broken light” ENDSELECT
Iteration Constructs
DO WHILE - Test at top, 0 or more loops
DO UNTIL - Test at bottom, 1 or more loops
Access Modifiers
Protected
Internal
Protected Internal
Public
single dimension array
decimal[] money = new decimal[100];
rectangular 2-D
type[ , ] identifier = new type [intValue, intValue];
jagged 2-D
type[][] identifier = new type [intValue] [];