IS340 MDTERM EXAM
Dr. Robert Chi, August 2, 1999

Instructions:

1. You have 90 minutes (12:00am-1:30pm) to finish this exam; the time you submit your exam will be based on the time stamp from the computer. Late submission will be penalized.
2. It is an open book open notes exam, however, discussion is strictly prohibited.
3. please do not exceed the right boarder of the answer boxes.
4. Total points 100 (20 points per question)
 

 

Please Enter Your Name:

Please Enter Your location (room number, home..) 

Questions:

1. Use IF THEN statement to write a piece of code so that

900 <= sales<1000 comission = 10%

800 <= sales < 900 commission = 9%

700 <= sales < 800 commion = 8%

sales <700  commion =7%

 
 

2. After the user enters a number into textbox1, write VB code to check if it is a number.   Respond a message box if non-numeric value is entered

 - The title of the box is "ERROR!"

- The contents of the box is "please enter a number"

- The OK button will be displayed
 

3. Dim abc as string

Dim def as string

abc = "1234"

def = "-1234"

Evaluate the following statements
abc > def
val(abc) >= val(def)

(true or false)?

4. Dim abc As Double
    Dim xyz As Double
    FormatCurrency(abc) = ?
    FormatCurrency(xyz) = ?
    FormatPercent(abc) = ?
    FormatPercent(xyz) = ?

 5. Explain why module level variables are needed? Give me an example.