CIS 230 - Visual Basic

Ch. 7 Worksheet #2 Answers

Determine the value of the following expressions where:

strName = "Johnny Appleseed"
strTeam = "Yankees"
strPlace = "Idaho"
strState = "New York"
strAmount = "123.45"

  1. Left(strTeam, 3) =                  check answer


  2. Right(strAmount, 4) =            check answer


  3. Mid(strPlace, 2, 3) =              check answer


  4. Mid(strName, 11, 1) =            check answer


  5. Len(strTeam) =                        check answer


  6. Right(Left(strTeam,6), 2) =       check answer


  7. Mid(Mid(strState, 3), 2, 1) = " "


  8. Left(strName, Len("hello")) = "Johnn"


  9. Left(strState, 3) & Right(strState, 4) = "NewYork"


  10. Len(strPlace) + Val(Mid(strAmount, 2, 2)) = 28