EBK STARTING OUT WITH VISUAL BASIC
7th Edition
ISBN: 8220102744202
Author: Irvine
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 4, Problem 10AW
Program Plan Intro
Select Case statement:
- A Select Case statement allows a variable to test for equality against a list of values.
- Each value is known as a case and variable that is switched on is checked for each select case.
- The syntax for a Select Case statement is given below:
Select [Case] expression
[Case expressionlist
[statements]]
[Case Else
[Elsestatements]]
End Select
- In the above syntax, expression is something that must evaluate to an elementary data type in visual basic.
- expressionlist is a list of expression clauses representing match values for expression.
- Statements following Case runs if the selected expression matches any clause in expressionlist.
- Else statements are statements following Case Else that run if the select expression does not match any clause in the expressionlist.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The Select Case statement shown in Figure 5-86 contains one or more errors. Identify the error(s) and rewrite the statements correctly.
Select Case intNumberOfSeats
Case > 5000
strVenueType = "Stadium"
Case > 2000
strVenueTYpe
"Amphitheater"
Case > 1000
strVenueType = "Auditorium"
Case > 200
strVenueTYpe
"Theater"
Case > 0
strVenueType = "Club"
Else Case
strVenueType
"Error"
Select End
Write an assignment statement that increments the intTotal variable by the contents of the intQuantity variable.
Write an if-else statement that determines whether the points variable is outside the range of9 to 51. If the variable’s value is outside this range it should display “Invalid points.”Otherwise, it should display “Valid points.”
Chapter 4 Solutions
EBK STARTING OUT WITH VISUAL BASIC
Ch. 4.2 - Prob. 4.1CPCh. 4.2 - In the following If Then statement, assume that...Ch. 4.2 - Do both of the following If Then statements...Ch. 4.2 - Prob. 4.4CPCh. 4.3 - Prob. 4.5CPCh. 4.4 - The following If Then ElseIf statement has...Ch. 4.4 - Prob. 4.7CPCh. 4.6 - Prob. 4.8CPCh. 4.7 - Prob. 4.9CPCh. 4.7 - Prob. 4.10CP
Ch. 4.8 - Convert the following If Then Elself statement...Ch. 4.10 - Prob. 4.12CPCh. 4.10 - Prob. 4.13CPCh. 4.10 - Write a Boolean expression that equals true when a...Ch. 4.10 - Prob. 4.15CPCh. 4.10 - Prob. 4.16CPCh. 4 - A (n) _______structure allows a program to execute...Ch. 4 - A (n) _______operator determines if a specific...Ch. 4 - Boolean expressions can only be evaluated as_____...Ch. 4 - A (n)_______is a Boolean variable that signals...Ch. 4 - Prob. 5FIBCh. 4 - Prob. 6FIBCh. 4 - A(n)________ If statement is an If statement that...Ch. 4 - _______operators connect two or more relational...Ch. 4 - Prob. 9FIBCh. 4 - Prob. 10FIBCh. 4 - Prob. 11FIBCh. 4 - Prob. 12FIBCh. 4 - Prob. 13FIBCh. 4 - Prob. 14FIBCh. 4 - Prob. 15FIBCh. 4 - Prob. 16FIBCh. 4 - Prob. 17FIBCh. 4 - Prob. 18FIBCh. 4 - ________ is the process of inspecting input values...Ch. 4 - Prob. 20FIBCh. 4 - Prob. 21FIBCh. 4 - Prob. 1TFCh. 4 - T F: It is not possible to write Boolean...Ch. 4 - Prob. 3TFCh. 4 - T F: Clicking on a radio button selects it and...Ch. 4 - T F: Radio buttons that are placed inside a group...Ch. 4 - Prob. 6TFCh. 4 - Prob. 7TFCh. 4 - Prob. 8TFCh. 4 - Prob. 9TFCh. 4 - Prob. 10TFCh. 4 - Prob. 1MCCh. 4 - This statement can cause other program statements...Ch. 4 - Prob. 3MCCh. 4 - This statement is like a chain of If statements....Ch. 4 - When placed at the end of an IfThenElself...Ch. 4 - When an If statement is placed inside another If...Ch. 4 - This operator connects two Boolean expressions...Ch. 4 - This operator connects two Boolean expressions...Ch. 4 - Prob. 9MCCh. 4 - This operator connects two Boolean expressions...Ch. 4 - When determining whether a number is inside a...Ch. 4 - When determining whether a number is outside a...Ch. 4 - Prob. 13MCCh. 4 - This method attempts to convert a value to...Ch. 4 - Prob. 15MCCh. 4 - Describe the difference between the If Then ...Ch. 4 - In an IfThenElseIf statement, what is the purpose...Ch. 4 - What is a flag and how does it work?Ch. 4 - Briefly describe how the And operator works.Ch. 4 - Briefly describe how the Or operator works.Ch. 4 - How is the Xor operator different from the Or...Ch. 4 - Prob. 7SACh. 4 - How is the OrElse operator different from the Or...Ch. 4 - Why are the relational operators called...Ch. 4 - Prob. 2WDTCh. 4 - Why does Visual Studio automatically indent them...Ch. 4 - Prob. 4WDTCh. 4 - Prob. 1FTECh. 4 - Prob. 1AWCh. 4 - Write an IfThen statement that assigns 0 to intX...Ch. 4 - Write an IfThen statement that multiplies...Ch. 4 - Prob. 4AWCh. 4 - Write an IfThen statement that sets the variable...Ch. 4 - Write an IfThenElse statement that assigns 1 to...Ch. 4 - The string variable strPeople contains a list of...Ch. 4 - Write an IfThen statement that prints the message...Ch. 4 - Write an IfThen statement that prints the message...Ch. 4 - Prob. 10AWCh. 4 - Prob. 1PCCh. 4 - Roman Numeral Converter The Roman Numeral...Ch. 4 - Fat Percentage Calculator Create an application...Ch. 4 - Weekly Temperatures with Validation Programming...Ch. 4 - Software Sales Software companies often offer...Ch. 4 - Sailboat Race Ranking Programming Challenge 7 in...Ch. 4 - Pay Per Click Advertising Revenue Many Web sites...Ch. 4 - Speed of Sound The following table shows the...Ch. 4 - Prob. 9PCCh. 4 - Name Formatting Create an application that lets...Ch. 4 - Prob. 11PCCh. 4 - Museum Tours Write a program that lets the user...Ch. 4 - Prob. 13PCCh. 4 - Mass and Weight Scientists measure an objects mass...Ch. 4 - Book Club Points Serendipity Booksellers has a...Ch. 4 - Body Mass Index Program Enhancement In Programming...Ch. 4 - Magic Dates The date June 10, 1960, is special...
Knowledge Booster
Similar questions
- Write a Case clause that specifies all numbers less than 0.arrow_forwardWrite an if/elif statement that assigns a value to the variable bonus depending on the amount of sales, which will be input. Sales Bonus Greater than or equal to 100,000 10,000 Greater than or equal to 75,000 5,000 Greater than or equal to 50,000 2,500 Greater than or equal to 25,000 1,000 Input Format a whole number Constraints input will be positive Output Format One of the bonus amounts listed in the problem statement. Sample Input 0 200000 Sample Output 0 Your bonus is $10,000.00arrow_forwardTrue or False: A conditionally executed statement should be indented one level from the if clause.arrow_forward
- Please help with c# questionsarrow_forwardIn the swich-case statement, if no case label matches, then the computer will execute the break default Last case First casearrow_forwardWrite a multiple-alternative selection structure that determines the appropriate discount rate based on a promotion code entered by the user. The user’s entry is stored in the intPromoCode variable. The valid promotion codes are 1, 2, 3, and 4. The corresponding discount rates are 2%, 5%, 10%, and 25%, respectively. Assign the discount rate (converted to decimal) to the decRate variable. If the user enters an invalid promotion code, assign the number 0 to the decRate variable. Use the If/ElseIf/Else form of the If... Then...Else statement.arrow_forward
- Variable scope is the area in your code where a variable can be accessed? True or Falsearrow_forwardIn order to perform a NOT operation on a variable in Verilog code, should the NOT operator be placed before or after the variable? Before Afterarrow_forwardThe expression 8 >= 4 + 6 OrElse 5 > 6 AndAlso 4 < 7 evaluates to_______ . a. Trueb. Falsearrow_forward
- The INVERSE of the statement: If a >2 , then a2>4.arrow_forwardWrite an assignment statement that increments the intNumEmployees variable by 1.arrow_forwardThe Select Case statement shown in Figure 5-87 contains one or more errors. Identify the error(s) and rewrite the statements correctly. Select Case charFlightCode Case 'F', 'A' lblFare. Text = 'First Class' Case 'B', 'Q' lblFare.Text = 'Business Class' Case 'Y', 'S', 'M' lblFare.Text = 'Full Fare Economy' Case 'K', 'C' lblFare. Text = 'Preferred Economy' Case 'U', 'J', 'P', 'G' lblFare. Text = 'Economy' Else lblFare.Text 'Unknown' End Selectarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT