Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Workshop

The quiz questions and exercises are provided for your further understanding. See Appendix B for the answers.

Quiz

  1. What is a datatype?

  2. What is the difference between a String and a Boolean datatype?

  3. What are two controls that behave as if they conform to the Boolean datatype?

  4. What is the difference between a literal and a variable?

  5. Which of the following are invalid variable names?

    12Months
    a
    85
    "curSalesForecast"
    Acctg98
                  
  6. Which operator performs two operations?

  7. What is the difference between a fixed-length string and a variable-length string?

  8. What value would Visual Basic store in the following ans variables?

    a. ans = 1 + 2 + 3 + 4 / 2
    b. ans = 1 + 2 + 3 + (4 / 2)
    c. ans = 2 ^ 5
    d. ans = 25 - 8 / 2 ^ 2 + 1
                  

Exercises

  1. Write code that declares these variables: your first name, your last name, your age, your tax rate, and whether you are married.
  2. Write an application that accepts your age in a text box and then displays, when you click a command button, your age in dog years (your age divided by 7). Don't worry about rounding that might take place.

Share ThisShare This

Informit Network