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)
- 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_forwardLecture Note Form : F = ±(0.d₁d2d3... dm) ße, Normalized Form : F= ±(1.d₁d2d3 ... dm) B Be Denormalized Form : F= ±(0.1d₁d2d3 ·dm) 3 ße ... Let ß = 2, m = 4, emin = -1 and emax = 2. Answer the following questions: (a) Compute the minimum of r for normalized form. (b) Compute the Machine Epsilon value for the normalized form. Compute the maximum delta value for the form given in Eq. (1). (c) .(i) .(ii) .(iii)arrow_forward
- QUESTION 3 An "if.else" statement (without esle if) is used when The 'yes' and 'no' conditions in the diagram end in different points When you need one action to execute if the conditional evaluate to "True' and a different action when it evaluated to "False" When the condition evaluates to True O When the condition evaluates to Falsearrow_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_forwardT/F 4. The == operator can always be used to test whether two values are identical when evaluating some primitive kind of variable.arrow_forward
- Provided 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_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_forwardSerendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awareded as follows: If a customer purchases 0 books, he or she earns 0 points. If a customer purchases 1 book, he or she earns 5 points. If a customer purchases 2 books, he or she earns 15 points. If a customer purchases 3 books, he or she earns 30 points. If a customer purchases 4 or more books, he or she earns 60 points. Creat an application in C# that lets the user enter the number of books that he or she has purchased this month and displays the number of points awarded.arrow_forward
- Write 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_forwardWrite 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_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
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT