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, Student Value Edition (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)
- Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases no books, he or she earns 0 points If a customer purchases 1 through 5 books, he or she earns 5 points for each book. If a customer purchases 6 through 10 books, he or she earns 10 points for each book. If a customer purchases 11 or more books, he or she earns points equal to 20 points for each book. (Use Python) Use the Design Recipe to write the function customer_rewards which consumes the number of books purchased, and returns the total points. Include a docstring! Write 3 assert_equal statements to test your function.arrow_forwardThe INVERSE of the statement: If a >2 , then a2>4.arrow_forwardQUESTION 5 You need to use a nested If statement when O You have 2 or more conditions. The second (or third) condition is an 'if.else' statement You have 2 conditions. The second condition is only evaluated if the first condition is True You have 3 conditions. The second condition is only evaluated if the first condition is false You have 3 conditions. The second condition is only evaluated if the first condition is Truearrow_forward
- Write 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_forwardProvided below is an if statement. Which of the following select case statements can be used to replace the if statement? if grade = “A” then price = price * 2 else if grade = “B” then price = price * 1.14 else if grade = “C” then price = price * 0.9125 else if price > 50 then price = price + 5 else price = price – 4 endif endif endif endif Select one: a.select case grade case “A” price = price * 2 case “B” price = price * 1.14 case “C” price = price * 0.9125 case else if price > 50 then price = price + 5 else price = price – 4 endif endselect b. select case case “A” price = price * 2 case “B” price = price * 1.14 case “C” price = price * 0.9125 case else if price…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
- Write an if/else statement that compares the value of two variables, lastYrTaxes and estimatedTaxes, and modifies the value of a boolean variable oweMoney appropriately as follows. oweMoney should be true when lastYrTaxes is lower than estimated Taxes and false when that is not the case.arrow_forwardT/F 6. An else clause may or may not be part of an if statement, but it must be part of an if statement.arrow_forwardComputer 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_forward
- The strict equal operator is Select one: a. != b.== C.=== d.=arrow_forward4. Write an if statement that increases pay by 3% if score is greater than 90, otherwise increases pay by 1%.arrow_forwardQuèstion 4 In the swich-case statement, if no case label matches, then the computer will execute the default First case break Last casearrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT