Introduction to Programming Final Study Guide

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

The concatenation operator in Visual Basic.

&

A For...Next statement contains the following For clause: For intX As Integer = 5 To -1 Step -2. What value will cause the For...Next loop to stop?

-3

If the txtGrossPay control contains the number 1234.78, what number will the Integer.TryParse(txtGrossPay.Text, intGross) statement assign to the intGross variable?

0

A For...Next statement contains the following For clause: For intX As Integer = 3 To 11 Step 3. What value will cause the For...Next loop to stop?

12

A numeric variable used for accumulating (adding together) something

Accumulator

Composed of an arithmetic operator followed by the assignment operator; can be used to abbreviate assignment statements that have a specific format.

Arithmetic assignment operators

Errors in an application's code

Bugs

The ampersand (&); used to concatenate strings; must be both preceded and followed by a space character.

Concatenation operator

Which of the following advances the insertion point to the next line in a control?

ControlChars.NewLine

Which of the following refers to the Backspace key on a computer keyboard?

ControlKey.Back

A numeric variable used for counting something.

Counter

A loop whose processing is controlled by a counter; the loop body will be processed a precise number of times.

Counter-controlled loop

Updating a counter or an accumulator by subtracting an amount from it.

Decrementing

Write a Visual Basic Do clause that tells the computer to process the loop instructions as long as the value in the intQuantity variable is greater than the number 0. Use the While keyword to create a looping condition.

Do While intQuantity > 0

A Visual Basic statement that can be used to code a pretest loop.

Do...Loop statement

A loop whose instructions are processed indefinitely; also called an infinite loop.

Endless loop

The instructions in a pretest loop will always be processed at least once

False

Method that calculates and returns a periodic payment on either a loan or an investment.

Financial.Pmt method

Which of the following calculates an annual payment on a $20,000 loan? The term is 5 years and the annual interest rate is 3%.

Financial.Pmt(.03, 5, 20000)

Write a Visual Basic For clause that creates a counter named intX and initializes it to 10. While the loop is processing, the counter should have values of 10, 12, 14, 16, 18, and 20. The loop should stop when the counter's value is 22.

For intX As Integer = 10 To 20 Step 2

Used to code a pretest counter-controlled loop.

For...Next statement

A property of the KeyPress event procedure's e parameter; used to cancel the key pressed by the user.

Handled property

Which of the following determines whether the user pressed a key that is not a number or the Backspace key?

If e.KeyChar < "0" OrElse e.KeyChar > "9" AndAlso e.KeyChar <> ControlChars.Back Then

Which of the following determines whether the user pressed the $ key?

If e.KeyChar = "$" Then

Updating a counter or an accumulator by adding an amount to it.

Incrementing

Another name for an endless loop.

Infinite loop

The process of assigning a beginning value to a memory location, such as a counter or an accumulator.

Initializing

Displays an input dialog box containing a message, OK and Cancel buttons, and an input area.

InputBox function

A property of the KeyPress event procedure's e parameter; stores the character associated with the key pressed by the user.

KeyChar property

Occurs each time the user presses a key while the control has the focus.

KeyPress event

Another name for the repetition structure.

Loop

Write a Visual Basic Loop clause that processes the loop instructions as long as the value in the intQuantity variable is greater than the number 0. Use the While keyword to create a looping condition.

Loop While intQuantity > 0

The instructions within a loop.

Loop body

The requirement that must be met for the computer to stop processing the loop body instructions.

Loop exit condition

The requirement that must be met for the computer to continue processing the loop body instructions.

Looping condition

The text box property that specifies the maximum number of characters that the user can enter in the text box.

MaxLength property

Displays a message box that contains a message, title bar text, a button, and an icon; allows the application to communicate with the user during run time

MessageBox.Show method

Which of the following creates a message box that displays an OK button, an Information icon, "Hatfield Sales" in the title bar, and the "Please enter a sales amount" message?

MessageBox.Show("Please enter a sales amount", "Hatfield Sales", MessageBoxButtons.OK, MessageBoxIcon.Information)

Write a MessageBox.Show method that displays "You win!" as the message, "Game Over" in the title bar, an OK button, and an Information icon.

MessageBox.Show("You win!", "Game Over", MessageBoxButtons.OK, MessageBoxIcon.Information)

For a text box to display scroll bars, which of the following properties must be set to True?

Multiline

The Visual Basic feature that exposes a set of commonly-used objects (such as the Computer object) to the programmer.

My feature

Write a Visual Basic statement that will play an audio file named Giggle.wav.

My.Computer.Audio.Play("Giggle.wav")

Which of the following will play the MySong.wav file stored in the current project's bin\Debug folder?

My.Computer.Audio.Play("MySong.wav")

A loop whose condition is evaluated after the instructions in its loop body are processed.

Posttest loop

A loop whose condition is evaluated before the instructions in its loop body are processed.

Pretest loop

The input instruction that appears above the loop that it controls; used to get the first input item from the user.

Priming read

A method used to refresh (redraw) a form.

Refresh method

The control structure used to repeatedly process one or more program instructions either while a looping condition is true or until a loop exit condition becomes true; also called a loop.

Repetition structure

Which of the following properties determines whether a text box contains a scroll bar?

ScrollBars

Method used to delay program execution.

Sleep method

Represents the empty string in Visual Basic.

String.Empty

Write a statement that tells the computer to pause program execution for 1 second.

System.Threading.Thread.Sleep(1000)

What is the first guideline for selecting test data?

Test the application without entering any data.

Removes spaces from both the beginning and end of a string.

Trim method

The condition in a posttest loop can be phrased as either a looping condition or a loop exit condition

True

The input instruction that appears within a loop and is associated with the loop's condition.

Update read

The process of adding a number to (or subtracting a number from) the value stored in a counter or an accumulator.

Updating

If the outer loop is a pretest loop, then the nested loop ____.

can be either a pretest loop or a posttest loop

When the user types the number 9 in a text box, the 9 is sent to the KeyPress event's _____ parameter.

e

Which of the following statements can be used in a text box's KeyPress event to cancel the key pressed by the user?

e.Handled = True

Use the appropriate arithmetic assignment operator to abbreviate the following assignment statement: intNum = intNum-5.

intNum -= 5

Write an assignment statement that concatenates the message "She lives in " with the contents of the strCity variable, and then assigns the result to the lblCity control.

lblCity.Text = "She lives in " & strCity

Which of the following Loop clauses will stop the loop only when the intAge variable's value is less than the number 0?

loop while intage >=0

If the startValue in a For clause is greater than the endValue, the stepValue must be a(n) ______ for the For...Next loop to be processed.

negative number

A clock uses a(n) ____ loop to keep track of the hours, and a(n) ___ to keep track of the minutes.

nested, outer

How can you prevent the user from editing the contents of a text box during run time?

set the textbox's ReadOnly property to True

Which of the following statements removes any leading and trailing spaces from the strCity variable?

strCity = strCity.Text.Trim

Write a statement that first removes any leading and/or trailing spaces from the strDept variable and then changes the contents of the variable to uppercase.

strDept = strDept.Trim.ToUpper

Write a statement that assigns an InputBox function's return value to the strItem variable. The text "Item Name" should appear in the dialog box's title bar. The "Enter the item:" message should appear inside the dialog box. The input area should be empty.

strItem = InputBox("Enter the item:", "Item Name")

Write the statement to remove any leading and/or trailing spaces from the txtState control.

txtState.Text = txtState.Text.Trim

For the Financial.Pmt method to display an annual payment, you will need to _____.

use the annual interest rate


Kaugnay na mga set ng pag-aaral

ANTHROPOLOGY.111 EXAM 1 USI W/ DR. DAUER

View Set

Potter and Perry Chapter 46 Bowel Elimination

View Set

Pharmacology- Renal and Cardiovascular (UWORLD)

View Set

Microeconomics Exam #1 Chapters: 1 & 3

View Set

Sociology Chapter 1: Study Guide

View Set

Gestalt (5 principles of visual perception)

View Set