Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Debugging Exercises 1. Fix the error(s) in the following line of code. decVideoT

ID: 3848079 • Letter: D

Question

Debugging Exercises 1. Fix the error(s) in the following line of code. decVideoTitle = strVideoTitle(Text.Length) 2. Fix the error(s) in the following lines of code. If (chkSpeedingTicket.Checked) = True Then decSpeedingTicket += 120 End If 3. What will be contained in the Text property of the lblResult Label object after executing the following code? Dim strPhrase As String strPhrase = “ Live long” strPhrase += “ and prosper ” strPhrase = strPhrase.Trim() lblResult.Text=strPhrase 4. What is the output of the following code? Dim strPhrase As String strPhrase = “Shut the front door” lblResult.Text= “Count =” & strPhrase.Length 5. Write the output that would be displayed in the Info label after the following statements are executed. lblInfo.Text = “Home Address: “ & “ ” & “3506 Wards Rd” & “ ” & “Lynchburg, VA 24 502”

Explanation / Answer

1) use substring method to get the title.

  decVideoTitle = strVideoTitle.Substring(0,Text.Length)

2)Correct answer : (chkSpeedingTicket.Checked) == True

we should use == operator for checking whether value is True or not

3)Correct answer : " Live long and prosper"

since "Live long" is appended with " and prosper" using "+=" operator.

4) strPhrase.Length = 19 = 10011 in bitwise

"Count=" is 010000110110111101110101011011100111010000111101 in binary ( done using text to binary converter online )

Now perform AND operation on both bit strings :

010000110110111101110101011011100111010000110001

Convert this result binary string to string again (using online binary to text converter)

then result is :

"Count1"

5)

“Home Address: “ in bits is 01001000011011110110110101100101001000000100000101100100011001000111001001100101011100110111001100111010

“ ” in bits is 00100000

“3506 Wards Rd” in bits is 00110011001101010011000000110110001000000101011101100001011100100110010001110011001000000101001001100100

“ ” in bits is 00100000

“Lynchburg, VA 24 502” in bits is 0100110001111001011011100110001101101000011000100111010101110010011001110010110000100000010101100100000100100000001100100011010000100000001101010011000000110010

Perform AND operation on all the bit strings, get the resultant bit string and finally convert it to string :

00100000

String form is " " i.e. empty space

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote