Concept explainers
Convert the following
If … Then … Elself statement into a Select Case statement.
If intQuantity >= 0 And intQuantity
<= 9 Then
decDiscount = 0.1
Elself intQuantity >= 10 And
intQuantity <= 19 Then
decDiscount = 0.2
Elself intQuantity >= 20 And
intQuantity <=29 Then
decDiscount = 0.3
Elself intQuantity >= 30 Then
decDiscount = 0.4
Else
MessageBox.Show("Invalid Data")
End If
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Starting Out With Visual Basic (8th Edition)
Additional Engineering Textbook Solutions
Digital Fundamentals (11th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Database Concepts (8th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Absolute Java (6th Edition)
- Write a Case clause that specifies all numbers less than 0.arrow_forwardWrite an If...Then...Else statement that displays the string “Overtime pay” in the lblMsg control when the number of hours contained in the decHours variable is greater than 40.arrow_forwardWrite an If....Then decision structure to compare the two numbers in the following variables: decDeveloperPay and decWebDesignerPay. Display a message box that states decDeveloperPay is greater than decWebDesignerPay. Write an If statement that displays the message box "Today was a good day" if the value in the variable intTemp is within the range from 30 to 35. this is for Visual Basic 2015arrow_forward
- Computer Science The user should enter his/her latest math course. If that course meets the computer science BAS requirements, congratulate the user. If the highest math course taken is not enough, recommend the next math course to take. - If the user input either of these math course (MATH &146MATH &148MATH &151MATH &152MATH &163 ) congratulate the user - if the user input either of this math course (MATH 081MATH 084MATH 085MATH 097MATH 098MATH 099MATH &107MATH 116MATH &141MATH &142) recommend the next math course to take in order. Html/Javascriptarrow_forwardIf the intTotalScore and intTests variables contain the numbers 200 and 0,respectively, the statement dblAvg = intTotalScore / intTests will_________ .a. assign 0 to the dblAvg variable b. result in a syntax error c. result in a logic error d. result in a run time errorarrow_forwardLab: switch Note: switch syntax is only applied for service selection. You can use if – else syntax for other comparison. Using switch syntax to write a program that calculates and prints the bill for a cellular telephone company. The company offers two types of service: regular and premium. Its rates vary, depending on the type of service. The rates are computed as follows: Regular service: $10.00 plus first 50 minutes are free. Charges for over 50 minutes are $0.20 per minutes. Premium service: $25 plus For calls made from 6:00 a.m to 6:00 p.m., the first 75 minutes are free; charges for more than 75 minutes are $0.10 per minute. For, calls made from 6:00 p.m. to 6:00 a.m., the first 100 minutes are free; charges for more than 100 minutes are $0.05 per minute. Your program should prompt the user to enter an account number, a service code (type char), and the number of minutes the service was used. A service code for r or R means regular service; a service…arrow_forward
- True or False? Every if statement must have a corresponding else.arrow_forwardWrite the first line of an if statement that calls the char.IsPuncuation method and passes the last character of a string variable named sentence as an argument.arrow_forwardWrite an if-else statement that works like this: If the sales variable is greater- than or equal-to 50,000, the commissionRate variable should be assigned the value 0.2. Otherwise, the commissionRate variable should be assigned the value 0.1.arrow_forward
- How is the OrElse operator different from the Or operator?arrow_forwardWrite an assignment statement that increments the intTotal variable by the contents of the intQuantity variable.arrow_forwardWrite an if-else statement that works like this: If the sales variable is greaterthan or equal-to 50,000, the commissionRate variable should be assigned the value 0.2. Otherwise, the commissionRate variable should be assigned the value 0.1.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning