Test 2 Flashcards

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”?

A

dunno

25
Q

What term is used to describe a loop that repeats endlessly?

A

infinite loop

26
Q

In VB, What is a control?

A

responsive objects a programmer places on a window/form

i.e., boxes and buttons

27
Q

What is an event procedure?

A

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
Q

the section of Vis Studio that has File, Edit, View, etc., is called the ___

A

Menu bar

29
Q

In Visual Studio, what’s so important about the Toolbox?

A

it holds all the controls, such as buttons, labels, textboxes, etc.

30
Q

“Form1.vb” is found in a box/window called the ___.

A

Solution Explorer

31
Q

According to good programming practice, how should you name controls?

A

with 3-letter prefixes that identify the type of object

p. 29

32
Q

The proper 3-letter prefix for a List box is:

A

lst

33
Q

List the 3 steps in creating a VB program:

A
  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
Q

The word ____ in the first line signals the beginning of the procedure

A

Sub

35
Q

The first line of an event procedure is called a ___.

A

header

36
Q

An event procedure starts with the words ____ and ends with the words _____.

A
  • Private Sub
  • End Sub
37
Q

What’s the difference between raising an event, versus handling an event?

A

Clicking a button raises the event;

the event procedure is said to handle the event

38
Q

What is contained within the body of an event procedure?

A

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
Q

What is the default event of a button control?

A

Click

see p. 45

40
Q

What is the default event of a textbox control?

A

TextChanged

see p. 45

41
Q

btnEvaluate_Click is an example of a:

A

procedure name

42
Q

Give an example of a function call.

A

CDbl, CStr, CInt

43
Q

CDbl, CStr, CInt are all examples of:

A

function call

44
Q

What is the basic template/format for a ForLoop? Write the code:

A

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
Q

What is the correct VB code for showing the total # of items in a List Box?

A

lstBox.Items.Count

46
Q

To distinguish them from event procedures, Function procedures and Sub procedures are referred to as ___.

A

General procedures

47
Q

What are the devices that VB has, that can break complex problems into smaller problems to be solved one at a time?

A
  • function procedures
  • sub procedures
48
Q

When talking of sub procedures, what is an argument?

A

An argument is anything we send to a method or sub procedure

the items inside the parentheses

49
Q

When talking of sub procedures, what is a parameter?

A

the variables appearing in the header

50
Q

What is Concatenation?

A

Concatenation is the joining of multiple strings into a single string, by using + and &

51
Q

What is a sub procedure?

A

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
Q

Where’s a local variable found?

A

A local variable is in your sub procedure

53
Q

An _____ starts with the words Private Sub and ends with the words End Sub.

A

event procedure