Deck 5: More on the Selection Structure

Full screen (f)
exit full mode
Question
Desk-checking is also called ____.

A)prototyping
B)hand-tracing
C)alpha checking
D)beta checking
Use Space or
up arrow
down arrow
to flip the card.
Question
The condition in a multiple-path selection structure is represented by a ____ in a flowchart.

A)diamond
B)square
C)circle
D)rectangle
Question
In a nested selection structure,the ____ decision is always made by the outer selection structure.

A)primary
B)secondary
C)binary
D)linear
Question
In a nested selection structure,the ____ decision is always made by the inner selection structure.

A)primary
B)secondary
C)binary
D)linear
Question
When a user selects a second CheckBox in a group,previously selected CheckBox items are deselected.
Question
The minimum number of radio buttons in a group is one.
Question
Reversing the primary and secondary logical decisions when writing a selection structure that contains a nested selection structure has no impact on the program's execution.
Question
The Select Case statement ends with the ____ clause.

A)End
B)End Case
C)End Select
D)Select End
Question
In a nested selection structure,the primary decision is always made by the outer selection structure.
Question
A selection structure that can choose from several alternatives is called a(n)____ selection structure.

A)dynamic
B)complex
C)secondary
D)extended
Question
The If/ElseIf/Else selection structure needs only one End If statement to mark the end of the selection structure.
Question
The set of step-by-step instructions for accomplishing a task is called a(n)____.

A)flow
B)desk-checking
C)alpha checking
D)algorithm
Question
An unnecessary selection structure within a nested selection structure will make the program inefficient.
Question
A meat packer grades meat "P" for Prime,"C" for Choice,"S" for Standard,and "G" for Good.Which of the following Case expressions is incorrect?

A)Case "P", "C"
B)Case "S"
C)Case "CGSP"
D)Case Else
Question
The default radio button is designated by setting the Checked property to a value of True.
Question
Programmers desk-check an algorithm to verify that it is not missing any steps,and that the existing steps are correct and in the proper order.
Question
When the Select Case statement includes a Case ____ clause,this clause must be the last clause in the statement.

A)Otherwise
B)Else
C)Next
D)Last
Question
A common error made when writing selection structures is to use a compound condition in the outer selection structure when a nested selection structure is needed.
Question
In a Case selection structure,each expression in an expression list is separated by a ____.

A)semicolon (;)
B)colon (:)
C)period (.)
D)comma (,)
Question
In a Case selection structure,the expression Case Is 10 To 5 would be an incorrectly formed case statement.
Question
You create the Random object by declaring it in a ____ statement.

A)Get
B)Dim
C)Sub
D)Private
Question
When the programmer wants to limit the user to one choice during input of mutually exclusive options,the ____ control should be used.

A)TextBox
B)CheckBox
C)RadioButton
D)Label
Question
The maximum number of radio buttons that can be selected from a group is ____.

A)one
B)three
C)five
D)seven
Question
After creating a Random object,you can generate random integers using the ____ method.

A)Random.Call
B)Random.Number
C)Random.Generate
D)Random.Next
Question
A selection structure's true path should calculate the ending inventory value only when the price entered by the user can be converted to a number.Which statement will return a Boolean value of True and store it in blnPriceOK if the number can be converted?

A)dblPrice.Text = Double.TryParse(txtPrice.Text, dblPrice)
B)blnPriceOK = Double.TryParse(txtPrice.Text, dblPrice)
C)blnPriceOK = Double.TryParse(dblPrice, txtPrice.Text)
D)dblPrice.Text = Double.TryParse(blnPriceOK.Text)
Question
The secondary decision for assigning the fee for folded clothes is to determine ____.

A)whether the customer is having a shirt, or pants, or a dress cleaned
B)when the customer will pick up the clothes
C)if the customer wants clothes hung or folded
D)if the customer wants clothes washed or dry cleaned
Question
Which of the following conditions will evaluate to True when the chkValidID check box is not selected?

A)If chkValidID.check = False Then
B)If chkValidID.check = No Then
C)If chkValidID.checked = No Then
D)If chkValidID.checked = False Then
Question
If the txtBalance control contains the value $52,what value will the Decimal.TryParse(txtBalance.Text,decBalance)method return?
C)52
D)0
Question
<strong>  If the intQuantity variable contains the number 25 and the customer is not a member,what value will be in the decTotal variable after the code is processed?</strong> A)0 B)312.50 C)350 D)375 <div style=padding-top: 35px>
If the intQuantity variable contains the number 25 and the customer is not a member,what value will be in the decTotal variable after the code is processed?

A)0
B)312.50
C)350
D)375
Question
You enter the label for a radio button using sentence capitalization in the radio button's ____ property.

A)Text
B)Label
C)Face
D)Heading
Question
The application needs to assign the fee for folded clothes.The primary decision for the scenario is to first determine ____.

A)whether the customer is having a shirt, or pants, or a dress cleaned
B)when the customer will pick up the clothes
C)if the customer wants clothes hung or folded
D)if the customer wants clothes washed or dry cleaned
Question
<strong>  If the intQuantity variable contains the number 20 and the customer is a member,what value will be in the decTotal variable after the code is processed?</strong> A)187.50 B)250 C)280 D)300 <div style=padding-top: 35px>
If the intQuantity variable contains the number 20 and the customer is a member,what value will be in the decTotal variable after the code is processed?

A)187.50
B)250
C)280
D)300
Question
The ____ event occurs each time you select or deselect a check box or radio button.

A)Checked
B)Changed
C)CheckedChanged
D)ChangedChecked
Question
In a Case selection structure,you use the ____ keyword when you know only one end of the range.

A)From
B)Is
C)To
D)Range
Question
When the programmer wants to allow the user to select any number of choices from a group of one or more independent and nonexclusive choices,the ____ control should be used.

A)TextBox
B)CheckBox
C)RadioButton
D)Label
Question
In a Case selection structure,you use the ____ keyword when you know both the upper and lower bounds of the range.

A)From
B)Is
C)To
D)Range
Question
Which of the following would be an appropriate use of a check box control?

A)Marital Status (Married, Single)
B)Gender (Female, Male)
C)Full Time - Part Time
D)Insurance Benefits (Health, Dental, Vision)
Question
An online bookseller uses the following schedule to determine the shipping costs: <strong>An online bookseller uses the following schedule to determine the shipping costs:   What is a correct case expression for a category II book order based upon Books Ordered?</strong> A)Case Is < 7 B)Case 4 To 7 C)Case Is 4 To 7 D)Case Between 4 and 7 <div style=padding-top: 35px> What is a correct case expression for a category II book order based upon Books Ordered?

A)Case Is < 7
B)Case 4 To 7
C)Case Is 4 To 7
D)Case Between 4 and 7
Question
When a check box is selected,its Checked property contains the ____.

A)Boolean value True
B)Boolean value False
C)numeric value 0
D)numeric value 1
Question
<strong>  If the intQuantity variable contains the number 10 and the customer is a member,what value will be in the decTotal variable after the code is processed?</strong> A)0 B)125 C)140 D)150 <div style=padding-top: 35px>
If the intQuantity variable contains the number 10 and the customer is a member,what value will be in the decTotal variable after the code is processed?

A)0
B)125
C)140
D)150
Question
BrightStar Day School needs an application to calculate the total monthly tuition charge for students.The tuition schedule is shown below:
BrightStar Day School needs an application to calculate the total monthly tuition charge for students.The tuition schedule is shown below:   Students in the Tuesday and Thursday class can attend on Friday for an extra fee of $10 for each Friday attended.Rewrite the following algorithm to correct any logic errors: If TR class and attend on Friday Tuition = 135 + 10 Else If MWF Tuition = 120 End If End If<div style=padding-top: 35px> Students in the Tuesday and Thursday class can attend on Friday for an extra fee of $10 for each Friday attended.Rewrite the following algorithm to correct any logic errors:
If TR class and attend on Friday
Tuition = 135 + 10
Else
If MWF
Tuition = 120
End If
End If
Question
Write a multiple-alternative selection structure that displays the name of an instructor based on the class section entered by the user.The class section is stored (as uppercase)in the strSection variable.Display "Edwards" when the class section is A.Display "Hughes" when the class section is B.Display "Meadows" when the class section is C.For all other sections,display "To Be Announced".Display the message in the lblMessage control.Use the Select Case statement.
Question
Define the term "algorithm." How is desk-checking used to verify algorithms?
Question
Jamestown Medical Center pays a year-end bonus (either $100 or $200)to all employees based on their participation in a wellness program.To receive the $100 bonus,employees must pass the annual health screening.To receive the $200 bonus,employees must pass the annual health screening and participate in the Healthy Life Workshop.If an employee does not pass the health screening,he or she does not receive a bonus.The application should display the bonus amount at the end.Write the algorithm for this application.
Question
What is a nested selection structure? How do primary and secondary decisions relate to a nested selection structure?
Question
A group of ____ should be used on the interface for the user to select the customer's preference for washing or dry cleaning the clothes.

A)radio buttons
B)check boxes
C)text boxes
D)labels
Question
Write a multiple-alternative selection structure that determines the shipping charge based on the total order amount entered by the user.The shipping charge is stored in the intShipCharge variable.The total order amount is stored in the decTotalOrder variable.The shipping charge is $9 for all orders under $25.The shipping charge is $8 for all orders of $25 to $50.The shipping charge is $7 for all orders where the total order amount is greater than $50.If the user does not enter a valid total order amount (less than 0),display "Please enter a valid amount." in the lblMessage control.Use the Select Case statement.
Question
Write an If...Then...Else statement that assigns a discount of $5 when a customer provides a coupon during checkout.If the customer does not provide a coupon,then there is no discount.The clerk must select the Coupon Provided check box for the customer to receive the discount.Create your own variable names.
Question
Ocean Resorts,Inc.pays a commission to employees based on an employee's sales and the number of years the employee has been with the company.Employee sales is stored in the decSales variable,and the number of years employed is stored in the intYears variable.The application should calculate the commission for an employee.The commission is 6% for sales of at least $100,000.If an employee's sales total is less than $100,000,the employee will receive a 3% commission if he or she has been with the company for two years or more.Otherwise,the employee does not receive a commission.Assign the commission to the decCommission variable.Write an If...Then...Else statement for the nested selection structure.
Question
An application needs to generate a random number that is greater than or equal to 1 but less than 348.Write the statements to generate the random number and assign it to the intNum variable.
Question
An application needs to generate three random numbers that can be from 1 to 9.The random numbers will be assigned to variables named intNum1,intNum2,and intNum3.Write the necessary statements to generate the random numbers and store them in their respective variables.The following Dim statements are provided:
Dim intNum1 As Integer
Dim intNum2 As Integer
Dim intNum3 As Integer
Question
Write the TryParse statement that will convert the string stored in the txtBalance control to a Decimal number.The Decimal number should be stored in the decBalance variable,and the Boolean value that is returned should be stored in the blnIsNumber variable.
Question
The price chart for Trent Wholesale is shown below.Rewrite the incorrect statements in the associated code to correct all errors.
The price chart for Trent Wholesale is shown below.Rewrite the incorrect statements in the associated code to correct all errors.   Case Select intQuantity Case < 10 intPrice = 12 Case Is 11 - 20 intPrice = 11 Case > 20 intPrice = 9 Case Else intPrice = 0 End Select<div style=padding-top: 35px> Case Select intQuantity
Case < 10
intPrice = 12
Case Is 11 - 20
intPrice = 11
Case > 20
intPrice = 9
Case Else
intPrice = 0
End Select
Question
Write a multiple-alternative selection structure that assigns an interest rate (.04,.05,.06)to the decInterestRate variable.The appropriate rate depends on the radio button selected by the user in the interface.The names of the radio buttons are rad4Rate,rad5Rate,and rad6Rate.Use the Select Case statement.
Question
The interface provides a text box for the user to enter the number of shirts being laundered.You want to make sure a string typed in by the user can be converted to a number to be used in the calculation for the total.Which of the following statements is valid?

A)strIsOK = TryParse(txtShirts.Text, intShirts)
B)strIsOK = Integer.TryParse(intShirts, txtShirts.Text)
C)blnIsOK = Integer.TryParse(txtShirts.Text, intShirts)
D)blnIsOK = TryParse(txtShirts.Text, intShirts)
Question
Logic errors in selection structures are a result of one of four common mistakes.List the four common logic errors made when writing selection structures.
Question
You meet with the manager to show her the interface and obtain feedback.She tells you that very few customers request dry cleaned clothes to be folded.She suggests only applying the folding fee if a customer makes a special request,and it should be calculated for all laundered items in a customer's order.You decide to make the folding fee ____.

A)a single radio button and remove it from the nested selection structure
B)a single check box and remove it from the nested selection structure
Question
Write a multiple-alternative selection structure that displays the name of an instructor based on the class section entered by the user.The class section is stored (as uppercase)in the strSection variable.Display "Edwards" when the class section is A.Display "Hughes" when the class section is B.Display "Meadows" when the class section is C.For all other sections,display "To Be Announced".Display the message in the lblMessage control.Use the If/ElseIf/Else form of the If...Then...Else statement.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/58
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 5: More on the Selection Structure
1
Desk-checking is also called ____.

A)prototyping
B)hand-tracing
C)alpha checking
D)beta checking
B
2
The condition in a multiple-path selection structure is represented by a ____ in a flowchart.

A)diamond
B)square
C)circle
D)rectangle
A
3
In a nested selection structure,the ____ decision is always made by the outer selection structure.

A)primary
B)secondary
C)binary
D)linear
A
4
In a nested selection structure,the ____ decision is always made by the inner selection structure.

A)primary
B)secondary
C)binary
D)linear
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
5
When a user selects a second CheckBox in a group,previously selected CheckBox items are deselected.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
6
The minimum number of radio buttons in a group is one.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
7
Reversing the primary and secondary logical decisions when writing a selection structure that contains a nested selection structure has no impact on the program's execution.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
8
The Select Case statement ends with the ____ clause.

A)End
B)End Case
C)End Select
D)Select End
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
9
In a nested selection structure,the primary decision is always made by the outer selection structure.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
10
A selection structure that can choose from several alternatives is called a(n)____ selection structure.

A)dynamic
B)complex
C)secondary
D)extended
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
11
The If/ElseIf/Else selection structure needs only one End If statement to mark the end of the selection structure.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
12
The set of step-by-step instructions for accomplishing a task is called a(n)____.

A)flow
B)desk-checking
C)alpha checking
D)algorithm
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
13
An unnecessary selection structure within a nested selection structure will make the program inefficient.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
14
A meat packer grades meat "P" for Prime,"C" for Choice,"S" for Standard,and "G" for Good.Which of the following Case expressions is incorrect?

A)Case "P", "C"
B)Case "S"
C)Case "CGSP"
D)Case Else
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
15
The default radio button is designated by setting the Checked property to a value of True.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
16
Programmers desk-check an algorithm to verify that it is not missing any steps,and that the existing steps are correct and in the proper order.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
17
When the Select Case statement includes a Case ____ clause,this clause must be the last clause in the statement.

A)Otherwise
B)Else
C)Next
D)Last
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
18
A common error made when writing selection structures is to use a compound condition in the outer selection structure when a nested selection structure is needed.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
19
In a Case selection structure,each expression in an expression list is separated by a ____.

A)semicolon (;)
B)colon (:)
C)period (.)
D)comma (,)
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
20
In a Case selection structure,the expression Case Is 10 To 5 would be an incorrectly formed case statement.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
21
You create the Random object by declaring it in a ____ statement.

A)Get
B)Dim
C)Sub
D)Private
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
22
When the programmer wants to limit the user to one choice during input of mutually exclusive options,the ____ control should be used.

A)TextBox
B)CheckBox
C)RadioButton
D)Label
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
23
The maximum number of radio buttons that can be selected from a group is ____.

A)one
B)three
C)five
D)seven
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
24
After creating a Random object,you can generate random integers using the ____ method.

A)Random.Call
B)Random.Number
C)Random.Generate
D)Random.Next
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
25
A selection structure's true path should calculate the ending inventory value only when the price entered by the user can be converted to a number.Which statement will return a Boolean value of True and store it in blnPriceOK if the number can be converted?

A)dblPrice.Text = Double.TryParse(txtPrice.Text, dblPrice)
B)blnPriceOK = Double.TryParse(txtPrice.Text, dblPrice)
C)blnPriceOK = Double.TryParse(dblPrice, txtPrice.Text)
D)dblPrice.Text = Double.TryParse(blnPriceOK.Text)
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
26
The secondary decision for assigning the fee for folded clothes is to determine ____.

A)whether the customer is having a shirt, or pants, or a dress cleaned
B)when the customer will pick up the clothes
C)if the customer wants clothes hung or folded
D)if the customer wants clothes washed or dry cleaned
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
27
Which of the following conditions will evaluate to True when the chkValidID check box is not selected?

A)If chkValidID.check = False Then
B)If chkValidID.check = No Then
C)If chkValidID.checked = No Then
D)If chkValidID.checked = False Then
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
28
If the txtBalance control contains the value $52,what value will the Decimal.TryParse(txtBalance.Text,decBalance)method return?
C)52
D)0
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
29
<strong>  If the intQuantity variable contains the number 25 and the customer is not a member,what value will be in the decTotal variable after the code is processed?</strong> A)0 B)312.50 C)350 D)375
If the intQuantity variable contains the number 25 and the customer is not a member,what value will be in the decTotal variable after the code is processed?

A)0
B)312.50
C)350
D)375
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
30
You enter the label for a radio button using sentence capitalization in the radio button's ____ property.

A)Text
B)Label
C)Face
D)Heading
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
31
The application needs to assign the fee for folded clothes.The primary decision for the scenario is to first determine ____.

A)whether the customer is having a shirt, or pants, or a dress cleaned
B)when the customer will pick up the clothes
C)if the customer wants clothes hung or folded
D)if the customer wants clothes washed or dry cleaned
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
32
<strong>  If the intQuantity variable contains the number 20 and the customer is a member,what value will be in the decTotal variable after the code is processed?</strong> A)187.50 B)250 C)280 D)300
If the intQuantity variable contains the number 20 and the customer is a member,what value will be in the decTotal variable after the code is processed?

A)187.50
B)250
C)280
D)300
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
33
The ____ event occurs each time you select or deselect a check box or radio button.

A)Checked
B)Changed
C)CheckedChanged
D)ChangedChecked
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
34
In a Case selection structure,you use the ____ keyword when you know only one end of the range.

A)From
B)Is
C)To
D)Range
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
35
When the programmer wants to allow the user to select any number of choices from a group of one or more independent and nonexclusive choices,the ____ control should be used.

A)TextBox
B)CheckBox
C)RadioButton
D)Label
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
36
In a Case selection structure,you use the ____ keyword when you know both the upper and lower bounds of the range.

A)From
B)Is
C)To
D)Range
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following would be an appropriate use of a check box control?

A)Marital Status (Married, Single)
B)Gender (Female, Male)
C)Full Time - Part Time
D)Insurance Benefits (Health, Dental, Vision)
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
38
An online bookseller uses the following schedule to determine the shipping costs: <strong>An online bookseller uses the following schedule to determine the shipping costs:   What is a correct case expression for a category II book order based upon Books Ordered?</strong> A)Case Is < 7 B)Case 4 To 7 C)Case Is 4 To 7 D)Case Between 4 and 7 What is a correct case expression for a category II book order based upon Books Ordered?

A)Case Is < 7
B)Case 4 To 7
C)Case Is 4 To 7
D)Case Between 4 and 7
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
39
When a check box is selected,its Checked property contains the ____.

A)Boolean value True
B)Boolean value False
C)numeric value 0
D)numeric value 1
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
40
<strong>  If the intQuantity variable contains the number 10 and the customer is a member,what value will be in the decTotal variable after the code is processed?</strong> A)0 B)125 C)140 D)150
If the intQuantity variable contains the number 10 and the customer is a member,what value will be in the decTotal variable after the code is processed?

A)0
B)125
C)140
D)150
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
41
BrightStar Day School needs an application to calculate the total monthly tuition charge for students.The tuition schedule is shown below:
BrightStar Day School needs an application to calculate the total monthly tuition charge for students.The tuition schedule is shown below:   Students in the Tuesday and Thursday class can attend on Friday for an extra fee of $10 for each Friday attended.Rewrite the following algorithm to correct any logic errors: If TR class and attend on Friday Tuition = 135 + 10 Else If MWF Tuition = 120 End If End If Students in the Tuesday and Thursday class can attend on Friday for an extra fee of $10 for each Friday attended.Rewrite the following algorithm to correct any logic errors:
If TR class and attend on Friday
Tuition = 135 + 10
Else
If MWF
Tuition = 120
End If
End If
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
42
Write a multiple-alternative selection structure that displays the name of an instructor based on the class section entered by the user.The class section is stored (as uppercase)in the strSection variable.Display "Edwards" when the class section is A.Display "Hughes" when the class section is B.Display "Meadows" when the class section is C.For all other sections,display "To Be Announced".Display the message in the lblMessage control.Use the Select Case statement.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
43
Define the term "algorithm." How is desk-checking used to verify algorithms?
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
44
Jamestown Medical Center pays a year-end bonus (either $100 or $200)to all employees based on their participation in a wellness program.To receive the $100 bonus,employees must pass the annual health screening.To receive the $200 bonus,employees must pass the annual health screening and participate in the Healthy Life Workshop.If an employee does not pass the health screening,he or she does not receive a bonus.The application should display the bonus amount at the end.Write the algorithm for this application.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
45
What is a nested selection structure? How do primary and secondary decisions relate to a nested selection structure?
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
46
A group of ____ should be used on the interface for the user to select the customer's preference for washing or dry cleaning the clothes.

A)radio buttons
B)check boxes
C)text boxes
D)labels
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
47
Write a multiple-alternative selection structure that determines the shipping charge based on the total order amount entered by the user.The shipping charge is stored in the intShipCharge variable.The total order amount is stored in the decTotalOrder variable.The shipping charge is $9 for all orders under $25.The shipping charge is $8 for all orders of $25 to $50.The shipping charge is $7 for all orders where the total order amount is greater than $50.If the user does not enter a valid total order amount (less than 0),display "Please enter a valid amount." in the lblMessage control.Use the Select Case statement.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
48
Write an If...Then...Else statement that assigns a discount of $5 when a customer provides a coupon during checkout.If the customer does not provide a coupon,then there is no discount.The clerk must select the Coupon Provided check box for the customer to receive the discount.Create your own variable names.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
49
Ocean Resorts,Inc.pays a commission to employees based on an employee's sales and the number of years the employee has been with the company.Employee sales is stored in the decSales variable,and the number of years employed is stored in the intYears variable.The application should calculate the commission for an employee.The commission is 6% for sales of at least $100,000.If an employee's sales total is less than $100,000,the employee will receive a 3% commission if he or she has been with the company for two years or more.Otherwise,the employee does not receive a commission.Assign the commission to the decCommission variable.Write an If...Then...Else statement for the nested selection structure.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
50
An application needs to generate a random number that is greater than or equal to 1 but less than 348.Write the statements to generate the random number and assign it to the intNum variable.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
51
An application needs to generate three random numbers that can be from 1 to 9.The random numbers will be assigned to variables named intNum1,intNum2,and intNum3.Write the necessary statements to generate the random numbers and store them in their respective variables.The following Dim statements are provided:
Dim intNum1 As Integer
Dim intNum2 As Integer
Dim intNum3 As Integer
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
52
Write the TryParse statement that will convert the string stored in the txtBalance control to a Decimal number.The Decimal number should be stored in the decBalance variable,and the Boolean value that is returned should be stored in the blnIsNumber variable.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
53
The price chart for Trent Wholesale is shown below.Rewrite the incorrect statements in the associated code to correct all errors.
The price chart for Trent Wholesale is shown below.Rewrite the incorrect statements in the associated code to correct all errors.   Case Select intQuantity Case < 10 intPrice = 12 Case Is 11 - 20 intPrice = 11 Case > 20 intPrice = 9 Case Else intPrice = 0 End Select Case Select intQuantity
Case < 10
intPrice = 12
Case Is 11 - 20
intPrice = 11
Case > 20
intPrice = 9
Case Else
intPrice = 0
End Select
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
54
Write a multiple-alternative selection structure that assigns an interest rate (.04,.05,.06)to the decInterestRate variable.The appropriate rate depends on the radio button selected by the user in the interface.The names of the radio buttons are rad4Rate,rad5Rate,and rad6Rate.Use the Select Case statement.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
55
The interface provides a text box for the user to enter the number of shirts being laundered.You want to make sure a string typed in by the user can be converted to a number to be used in the calculation for the total.Which of the following statements is valid?

A)strIsOK = TryParse(txtShirts.Text, intShirts)
B)strIsOK = Integer.TryParse(intShirts, txtShirts.Text)
C)blnIsOK = Integer.TryParse(txtShirts.Text, intShirts)
D)blnIsOK = TryParse(txtShirts.Text, intShirts)
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
56
Logic errors in selection structures are a result of one of four common mistakes.List the four common logic errors made when writing selection structures.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
57
You meet with the manager to show her the interface and obtain feedback.She tells you that very few customers request dry cleaned clothes to be folded.She suggests only applying the folding fee if a customer makes a special request,and it should be calculated for all laundered items in a customer's order.You decide to make the folding fee ____.

A)a single radio button and remove it from the nested selection structure
B)a single check box and remove it from the nested selection structure
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
58
Write a multiple-alternative selection structure that displays the name of an instructor based on the class section entered by the user.The class section is stored (as uppercase)in the strSection variable.Display "Edwards" when the class section is A.Display "Hughes" when the class section is B.Display "Meadows" when the class section is C.For all other sections,display "To Be Announced".Display the message in the lblMessage control.Use the If/ElseIf/Else form of the If...Then...Else statement.
Unlock Deck
Unlock for access to all 58 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 58 flashcards in this deck.