Explanation of Solution
a.
Given code:
'if the condition is true
If intX > 100
'Set the result
lblResult.Text = "Invalid Data"
'End the statement
End If
Error in the statement:
The “Then” keyword is missing in the “If” statement...
Explanation of Solution
b.
Given code:
'Create a variable "str" and set the value
Dim str As String = "Hello"
'Create an integer variable "intLength"
Dim intLength As Integer
'set the value of "intLength" as the length of "str"
intLength = Length(str)
Error in the statement:
The last statement should read “intLength = str.Length”...
Explanation of Solution
c.
Given code:
'if the condition is true
If intZ < 10 Then
'set the value of result
lblResult.Text = "Invalid Data"
Error in the statement:
The “End If” statement is missing in the above snippet.
Corrected statement:
'if the condition is true
If intZ < 10 Then
Explanation of Solution
d.
Given code:
'Create a variable "str" and set the value
Dim str As String = "123"
'if the condition is true
If str.IsNumeric Then
'set the result
lblResult.Text = "It is a number."
'end if condition
End If
Error in the statement:
The If statement should read: “If IsNumeric(str) Then”
Corrected statement:
'Create a variable "str" and set the value
Dim str As String = "123"
'if the condition is true
If IsNumeric(str) Then
'set the result
lblResult...
Explanation of Solution
Given code:
'start select case
Select Case intX
'case 1
Case < 0
'set the result
lblResult. Text = “Value too low”
'case 2
Case > 100
'set the result
lblResult. Text = “Value too high”
'else case
Case Else
'set the result
lblResult. Text =”Value just right”
'end select
End Select
Explanation:
The above code snippet is used to execute select statements. In the code,
- Start a select case
- Case 1 “<0”
- Set the result as “Value too low”
- Case 2 “>100”
- Set the result as “Value too high”
- Else Case
- Set the result as “Value just right”
- Case 1 “<0”
- End select statement.
Error in the statement:
The “Is” keyword is missing in the “Select Case” statements...
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
EBK STARTING OUT WITH VISUAL BASIC
- Number 3: Write a pseudocode and draw a flowchart to read age of a user. You should display the suitable message by using the following scheme: 0-5 - Baby6-14 - Child15-35 - Young36-55 - Middle aged56 & above - oldarrow_forwardPlease Debug this 2arrow_forwardPlease note only looking for the solution to problem 2 but problem 1 is needed to help you understand what is being asked *must be created using Visual Studio and C# Problem1 Word Counter Create an application with a method that accepts a string as an argument and returns the number of words it contains. For instance, if the argument is "Four score and seven years ago," the method should return the number 6. The application should let the user enter a string, and then it should pass the string to the method. The number of words in the string should be displayed. Average Number of Letters Problem2 Modify the program you wrote for Problem 1 (Word Counter) so it also displays the average number of letters in each word.arrow_forward
- True or False 3. Variable names can have spaces in themarrow_forwardThe C++ keyword used to declare a character is _____. Group of answer choices chars char character string ------------------ Which of the following is an Assignment? a.) int x;b.) x = 5;c.) y = x + 2; Group of answer choices a b c a and b b and c All of the above None of the abovearrow_forwardFunction for button "Show the Grades": • Name this function by your first name (for example, function fadil). • The user should fill all the textboxes: "Exam-1", "Exam-2", "Project" and "Exam-3" and then press the button. In case one of the textboxes is empty, a message will appear in alert box with the text "You should fill all the textboxes", This page says CSCI375 Grades You should fill all the textboxes Exam-1 78 Exam-2 Project 67 Exam-3 66 Show the Grades Your Grades: Publishing Date Published on: Change Background Color • The user should enter all the grades of the activities greater than or equal to 60, otherwise a message will appear in alert box with the text "You failed one of the activities", This page says CSCI375 Grades You failed one of the activities Exam-1 59 Exam-2 88 Project 76 Exam-3 90 Show the Grades Your Grades: Publishing Date Published on: Change Background Color After filling all the textboxes, entering the correct grades and pressing the button "Show the…arrow_forward
- Q: Textboxes are often used to receive input from the user. a) true b)Falsearrow_forwardselect pre increment operators .A variable++ .B ++variable .C variable-- .D --variablearrow_forward20. Random Number Guessing GameWrite a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over.Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses. USE RAPTOR PROGRAMarrow_forward
- Assume that the following variables contain the values shown:numberBig = 100numberMedium = 10numberSmall = 1wordBig = "Constitution"wordMedium = "Dance"wordSmall = "Toy”For each of the following Boolean expressions, decide whether the statement is true, false, or illegal.a. numberBig > numberSmallb. numberBig < numberMediumc. numberMedium = numberSmalld. numberBig = wordBige. numberBig = "Big"f. wordMedium > wordSmallg. wordSmall = "TOY"h. numberBig <= 5 * numberMedium + 50i. numberBig >= 2000j. numberBig > numberMedium + numberSmallk. numberBig > numberMedium AND numberBig < numberSmalll. numberBig = 100 OR numberBig > numberSmallm. numberBig < 10 OR numberSmall > 10n. numberBig = 300 AND numberMedium = 10 OR numberSmall = 1o. wordSmall > wordBigp. wordSmall > wordMediumarrow_forward// This pseudocode should determine and output the rental fees for cars.// Standard cars rent for $65 per day, compacts rent for $40 per day,// and subcompacts rent for $30 per day. Rentals for at least 7 days// receive a 20% discount. An error message is displayed if the car type// is not valid. start Declarations string carType num days num STD_RATE = 65 num COM_RATE = 40 num SUB_RATE = 30 num DAYS_FOR_DISCOUNT = 10 num DISCOUNT_RATE = 0.20 string QUIT = "ZZZZ" getReady() while carType <> QUIT detailLoop() endwhile finish()stop getReady() output Enter car type or , QUIT, to quit input carTypereturn detailLoop() output "Enter days rented " input days if carType = "Standard" then rate = STD_RATE else if car_Type = "Compact" then rate = COMPACT_RATE else if carType = "Subcompact" then rate = SUB_RATE else rate = 0 output "Invalid car type"…arrow_forwardq1 part b need c++ code in visual studio Determine whether the value of the variable age is greater than equal to 18. If it is print “Age is greater than equal to 18”.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning