Computer Programming - Chapter 4 - Review Part A

Name


A red asterisk (*) indicates required questions.


  1. There is a logic error in the following code, determine what the error is and rewrite the code so it is correct:
    If grade > 90 then
    'Display A for grade greater than or equal to 90
    Me.lblGrade.Text = "You have an A"
    End If*


  1. What is displayed in the label after the following statement executes? Does the label assignment reflect what was intended? If not, how should the statement be rewritten to produce the intended result?

    Dim score As Integer = 25
    If score >=100 Then
    Me.lblMessage.Text = "You won!"
    ElseIf score < 100 Then
    Me.lblMessage.Text = "Good try."
    ElseIf score < 50 Then
    Me.lblMessage.Text = "Practice more."
    End If*


  1. The condition of and If...Then statement is a Boolean expression.*
    Yes
    No


  1. A decision structure must have an Else clause.*
    Yes
    No


  1. It is good programming style to line up the If, the Else, and the End If in a decision structure, and to indent the lines in between.*
    Yes
    No


  1. The Select...Case statement must have the Case Else clause.*
    Yes
    No


  1. The Select...Case statement can only be used if you have more than two cases.*
    Yes
    No





Business/Technology Teacher
North High School
Wichita, KS