Test 2 Flashcards
When you program buttons, what are the categories for the coding?
(i.e., the green comments that you group your coding into?)
- ‘Variable declarations for Input
- ‘Assignment Statements for Input
- ‘Assignment Statements for Calculations
- ‘Output the data to the form
Give the format for Assigning the text entered in the Text Box control labeled “txtBill”, to a variable called “billAmount”.
variable = CStr(txtBox.Text)
e.g., billAmount = CDbl(txtBill.Text)
What type of code do you see under ‘Assignment Statements for Input?
variable = CDbl(txtBox.Text)
What type of code do you see under ‘Output Data to the Form?
txtBox.Text = CStr(calculationVariableFromTheCalcStep)
e.g., txtMpg.Text = CStr(milesPerGallon)
How do you clear out a text box?
ControlName.Text = ‘’ ‘‘
e.g.,
txtGradeTwo.Text = “”
OR
controlName.Clear
e.g.,
txtOne.Clear
How do you clear out a list box?
ControlName.Items.Clear( )
e.g., lstOutput.Items.Clear()
Give the basic Template for Adding Data to a LIST box:
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 do you program a text box to say: “Student name’s average is studentAvg”
txtOutput.Text = “Student “ & name & “‘s average is “ & CStr(studentAvg)
What is the VB code indicating that a radio box has been checked?
controlName.checked = True
e.g., (radSenior.Checked = True)
How do you program a text box to say Hello? What is the code?
controlName.text = “Hello”
e.g., textOne.Text = “Hello”
What is Tab Index?
the order in which your cursor moves when you hit Tab
Where in the Visual Studio program do you go to adjust the Tab properties of a control?
Right-Mouse-Click (RMC) on that control → click “Properties” → go to the BEHAVIOR section under the Properties window
Give the code to change the background color of a text box labelled “txtOne” to Green.
txtOne.BackColor = Color.Green
Give the code to change the color of the text, written inside a text box, to Blue.
controlName.ForeColor = Color.Blue
e.g., txtOne.ForeColor = Color.White
A text box is labelled txtOne. Give the code to change the color of the text, written inside a text box, to White.
txtOne.ForeColor = Color.White
What are the 3 operations that most programs perform?
Input
Process
Output
What is an algorithm?
logical sequence of precise steps to solve a problem
Examples of higher-level languages:
- VB
- Java
- C++
- Python
Give examples of a Control:
- labels
- textboxes
- buttons
- list boxes
- radio buttons
List the steps of the Software Development Life Cycle:
- Analyze
- Design
- Design the interface
- Code
- Test and correct
- Complete the documentation
Define coding.
it’s the technical word for writing a program