Test 2 Flashcards

(53 cards)

1
Q

When you program buttons, what are the categories for the coding?

(i.e., the green comments that you group your coding into?)

A
  • Variable declarations for Input
  • Assignment Statements for Input
  • Assignment Statements for Calculations
  • Output the data to the form
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give the format for Assigning the text entered in the Text Box control labeled “txtBill”, to a variable called “billAmount”.

A

variable = CStr(txtBox.Text)

e.g., billAmount = CDbl(txtBill.Text)

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

What type of code do you see under ‘Assignment Statements for Input?

A

variable = CDbl(txtBox.Text)

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

What type of code do you see under ‘Output Data to the Form?

A

txtBox.Text = CStr(calculationVariableFromTheCalcStep)

e.g., txtMpg.Text = CStr(milesPerGallon)

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

How do you clear out a text box?

A

ControlName.Text = ‘’ ‘‘

e.g.,

txtGradeTwo.Text = “”

OR

controlName.Clear

e.g.,

txtOne.Clear

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

How do you clear out a list box?

A

ControlName.Items.Clear( )

e.g., lstOutput.Items.Clear()

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

Give the basic Template for Adding Data to a LIST box:

A

ControlName.Items.Add( )

E.g.,

lstOutput.Items.Add(“Student Grade One Is: “ & CStr(gradeOne))

lstOutput.Items.Add(“Student Grade Two Is: “ & CStr(gradeTwo))

lstOutput.Items.Add(“Student Average Is: “ & CStr(average))

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

How do you program a text box to say: “Student name’s average is studentAvg

A

txtOutput.Text = “Student “ & name & “‘s average is “ & CStr(studentAvg)

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

What is the VB code indicating that a radio box has been checked?

A

controlName.checked = True

e.g., (radSenior.Checked = True)

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

How do you program a text box to say Hello? What is the code?

A

controlName.text = “Hello”

e.g., textOne.Text = “Hello”

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

What is Tab Index?

A

the order in which your cursor moves when you hit Tab

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

Where in the Visual Studio program do you go to adjust the Tab properties of a control?

A

Right-Mouse-Click (RMC) on that control → click “Properties” → go to the BEHAVIOR section under the Properties window

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

Give the code to change the background color of a text box labelled “txtOne” to Green.

A

txtOne.BackColor = Color.Green

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

Give the code to change the color of the text, written inside a text box, to Blue.

A

controlName.ForeColor = Color.Blue

e.g., txtOne.ForeColor = Color.White

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

A text box is labelled txtOne. Give the code to change the color of the text, written inside a text box, to White.

A

txtOne.ForeColor = Color.White

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

What are the 3 operations that most programs perform?

A

Input

Process

Output

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

What is an algorithm?

A

logical sequence of precise steps to solve a problem

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

Examples of higher-level languages:

A
  • VB
  • Java
  • C++
  • Python
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Give examples of a Control:

A
  • labels
  • textboxes
  • buttons
  • list boxes
  • radio buttons
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

List the steps of the Software Development Life Cycle:

A
  1. Analyze
  2. Design
  3. Design the interface
  4. Code
  5. Test and correct
  6. Complete the documentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Define coding.

A

it’s the technical word for writing a program

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

What is the purpose of documentation?

A

to allow another person to understand your program/coding

23
Q

What is pseudocode?

A

an abbreviated plain English version of actual computer code.

Uses English-like phrases with some VB terms to outline the task

24
Q

What term is used by the textbook for an “if statement”?

25
What term is used to describe a loop that repeats endlessly?
infinite loop
26
In VB, What is a **control**?
responsive objects a programmer places on a window/form i.e., boxes and buttons
27
What is an **event procedure**?
programming instructions in VB that tell your program how to respond to *events*, such as mouse clicks Essentially, anything executable in a VB program is in an event procedure p. 17, textbook
28
the section of Vis Studio that has File, Edit, View, etc., is called the \_\_\_
Menu bar
29
In Visual Studio, what's so important about the **Toolbox**?
it holds all the *controls*, such as buttons, labels, textboxes, etc.
30
"Form1.vb" is found in a box/window called the \_\_\_.
Solution Explorer
31
According to good programming practice, how should you name controls?
with 3-letter prefixes that identify the type of object ## Footnote p. 29
32
The proper 3-letter prefix for a List box is:
lst
33
List the 3 steps in creating a VB program:
1. Create the interface (i.e., *generate*, *position*, and *size* the objects) 2. Set properties (i.e., configure the appearance of the objects) 3. Write the code that executes when events occur
34
The word ____ in the first line signals the beginning of the procedure
Sub
35
The first line of an event procedure is called a \_\_\_.
header
36
An event procedure starts with the words ____ and ends with the words \_\_\_\_\_.
* Private Sub * End Sub
37
What's the difference between **raising** an event, versus **handling** an event?
Clicking a button **raises** the event; the event procedure is said to **handle** the event
38
What is contained within the **body** of an event procedure?
The coding found between **Private Sub** and **End Sub** makes up the Body of an Event Procedure. The body includes the object, and the event occurring to that object.
39
What is the default event of a **button** control?
Click see p. 45
40
What is the default event of a **textbox** control?
TextChanged see p. 45
41
**btnEvaluate\_Click** is an example of a:
procedure name
42
Give an example of a **function call**.
CDbl, CStr, CInt
43
CDbl, CStr, CInt are all examples of:
function call
44
What is the basic template/format for a ForLoop? Write the code:
for i as Integer = 0 To listBox.Items.Count - 1 Variable = CStr**/**CDbl**/**CInt(listBox.Items(i)) (possible If Then statements) Next *e.g.*: grade = CDbl(lstNumGrade.Items(i))
45
What is the correct VB code for showing the total # of items in a List Box?
lstBox.Items.Count
46
To distinguish them from event procedures, Function procedures and Sub procedures are referred to as \_\_\_.
**General** procedures
47
What are the devices that VB has, that can break complex problems into smaller problems to be solved one at a time?
* function procedures * sub procedures
48
When talking of sub procedures, what is an **argument**?
An **argument** is anything we send to a method or sub procedure the items inside the parentheses
49
When talking of sub procedures, what is a **parameter**?
the variables appearing in the header
50
What is **Concatenation**?
Concatenation is the joining of multiple strings into a single string, by using **+** and **&**
51
What is a sub procedure?
sub procedure is a section of code written by the programmer to perform a specific task . It is written outside the main procedure and will only execute when called .
52
Where's a **local variable** found?
A **local variable** is in your sub procedure
53
An _____ starts with the words Private Sub and ends with the words End Sub.
event procedure