Intro to Programming - CS3 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the arithmetic operators?

A

+, -, *, /

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

What are the relational operators and what is their result?

A

, <=, >=, =, <>

Results in True or False

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

What are the logical operators and what is their result?

A

AND, OR, NOT

Results in True or False

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

What is operator precedence?

A

First arithmetic, then relational, then logical

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

A=True, B=False
What is A OR B?
What is A AND B?

A

True

False

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

Expression

A

Any legal combo that represents a value (could be one or more constants, variables, operators, and/or functions)

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

Arithmetic expression

A

An expression with numbers, variables, and/or arithmetic operators

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

Relational expression

A

Two arithmetic expressions with a relational operator

Result is TRUE or FALSE

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

Logical expression

A

Has logical operator (and, or, not)
AND/OR need TWO operands
NOT needs only one

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

Structured Programming

A

Breaking a program into logical sections, using only three types of control structures

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

Control Structures in Structured Programming

A

Sequence
Selection
Iteration

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

Sequence control structure

A

One statement simply follows another in sequence; steps are executed in order.

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

Selection control structure

A

Program selects a path based on conditional statement
IF-THEN or
IF-THEN-ELSE

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

Iteration control structure

A
Looping or repeating control structure - statements execute repeatedly 
While Loop (WHILE condition is true, execute) 
For Loop (counter-controlled loop, execute specific number of times)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a keyword?

A

A word that has a special meaning to the compiler

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

What are each of these words?
Dim score as string
score = Textbox1.Text

A
Dim _ as > keywords to declare variable
score > name of variable 
string > data type 
= > assignment
you are assigning the TEXT property of the Textbox1 CONTROL to the variable score
17
Q

And

A

Both operands must be true for the expression to be true, otherwise it is false

18
Q

Or

A

One or both operands must be true for the expression to be true, otherwise it is false

19
Q

Not

A

Reverses the logical value of the expression

20
Q

Variable naming rules

A
  1. Can only have letters, digits, and underscores
  2. Cannot start with a number
  3. Cannot use a keyword
21
Q

Literal data

A

Any data in a program that explicitly identifies itself

22
Q

Symbolic constant

A

Defining a constant

Const float Pi = 3.14