Chapter 3 Flashcards

1
Q

Variables

A

An internal place where the computer temporarily stores data..contents can change as the program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Every Variable has a data type, ….?

A

name, scope, and lifetime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The variable data type determines….?

A

the type of data the variable can store.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Each data type is a __________?

A

Class..which means that each data type is a pattern from which one or more objects are created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Data Type: Boolean-Stores?

A

A logical value, true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Type: Char-Stores?

A

One Unicode character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Data Type: Date-Stores?

A

date and time info
date range: January 1, 0001 to December 31, 9999
time range: 0:00:00 midnight to 23:59:59

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Data Type: Decimal-Stores?

A

a number with a decimal place

+/- -7.982342343453264564364363234

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Data Type: Double-Stores?

A

a number with a decimal place

+/- -1.79442665463464636

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Data Type: Integer-Stores?

A

integer

-2 kabillion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Data Type: Long-Stores?

A

integer

-9 kabillion to +9 kabillion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Data Type: Object-Stores

A

data of any type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Data Type: Short-Stores

A

integer

range -32,768 to 32,767

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Data Type: Single-Stores?

A

a number with a decimal place

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Data Type: String-String?

A

text; 0 to 2 billion characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

These data types store whole numbers

A

Integer: -2 billion to 2 billion
Long: -9 kabillion to +9 kabillion
Short: -32, 768 to 32, 767

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

These data types store numbers with decimal places

A

Decimal is largest and used for money
Double (first two most commonly used)
Single

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

This data is the most general and most taxing on computer

A

Object data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Most common data type used for whole numbers

A

Integer, even if short works

20
Q

A variables name is also called an _______?

A

Identifier: Describes the contents of the variable

21
Q

Boolean ID = ?

A

bln

22
Q

Decimal ID = ?

A

dec

23
Q

Double ID = ?

A

dbl

24
Q

Integer ID = ?

A

int

25
Q

String ID = ?

A

str

26
Q

Variable Declaration Statement

A

Dim/Private/Static variableName As dataType [= initial value]

Ex. Dim intNumSold As Integer
Dim blnInsured As Boolean = True

27
Q

A variable is an object? T/F

A

True

28
Q

A variable is an instance of the class specified in the dataType info? T/F

A

True

29
Q

Literal Constant

A

item of data whose value does not change while the application is runing

30
Q

Syntax for assigning a value to a variable?

A
variableName = expression
intNumber = 25
31
Q

The TryParse method converts a __________ to a number?

A

String

32
Q

Explain what this does:

Double.TryParse(txtDue.Text, dblDue)

A

If the string contained in the txtDue controls’s Text property can be converted to a Double number, the TryParse method converts the string and then stores the result in the dblDue variable, otherwise, it stores the number 0 in the variable

33
Q

Explain what this does:

decorate = Convert.ToDecimal(.15)

A

Converts the Double number .15 to decimal and then assigns the result to the decRate variable

34
Q

Explain what this does:

decBonus = decSales * Convert.ToDecimal(.05)

A

Converts the double number .05 to decimal, multiplies it by the contents of the decSales variable and assigns it to the decBonus variable

35
Q

A variable’s scope indicates where the variable can be ____________ in an applications code.

A

used

36
Q

A variable’s lifetime indicates how _________ the variable remains in the computers internal memory

A

long

37
Q

Procedure level variable are designated with the keyword ________?

A

Dim

38
Q

Class-Level Variables are designated with the keyword ___________?

A

Private

39
Q

Const intLIMIT As Integer = 70 means what?

A

Declares intLIMIT as an Integer named constant and initializes it to the integer 70… it is all uppercase to distinguish between a variable

40
Q

Class Scope

A

a variable that can used by any procedure within the form

41
Q

Convert Class

A

contains methods that return the result of converting a value to a specified data type

42
Q

Forms Declaration Section

A

Located between the public class and end class clauses

43
Q

Implicit type conversion

A

process by which a value is automatically converted to fit the memory location to which it is assinged

44
Q

Literal Constant

A

an item of data whose value does not change during run time

45
Q

literal type character

A

a character such as the letter d, appended to a literal constant for the purpose of forcing the literal constant to assume a different data type such as decimal