First Exam Review Questions

Prepared by:Dr. Wael Mardini, updated by Dr. Monther Aldwairi,

Note: the exam questions will be in multiple choice form.

  1. Define each of the following ALU, BASIC, RAM, ROM, and GUI.
  2. What is machine language?
  3. What is the purpose of the Form Layout Window in VB?
  4. How you know that a line is a comment line? Hint: the first character in the line
  5. What is the difference between Name and Caption properties of an object?
  6. What are the initials used in naming the objects text box, label, picture box?
  7. How you represent a string constant? Hint: first and last character should be “
  8. How you store the input box result in a string variable x? How you store the input box result in an integer variable y?

Hint: x=inputbox(“enter value”) y=val(inputbox(“enter value”))

  1. What is the difference between drag and hover is using the mouse?
  2. Give an example of each of the following:
  3. Flowchart
  4. Psedocode
  5. Hierarchy chart
  6. Discuss the steps of the program development cycle, and their order importance.
  7. Which of the following is considered as an input tool, or an output one or both?
  8. Picturebox: for output
  9. Textbox:for input & output
  10. Label: for output
  11. Inputbox: for input
  12. How to change the font style and the size of the text within the code.

Example:

Text1.Font.Size=14

Text1.Font.Bold=True

  1. Mention the rules of naming variables in VB. Give examples of valid and invalid names.
  2. What is the default name of a label, command buttons, picture box, textbox, etc.

Text1, Text2,….. for textboxes

Command1, command2,…. For command buttons. … etc

  1. What is the purpose of the Chr, Val, Asc, and Str functions? Give examples.
  2. How to clear the pictureboxes, textboxes, and labels?

Text1.Text=””

Label1.Caption=””

Picture1.Cls

  1. What is the output of the following Code:
  2. Print “AB” & “CD”
  3. Print “AB”; ”CD”
  4. Print “AB” , “CD”
  5. Print “AB” & 1
  6. Print “AB” ; 4
  7. Print 3 & “AB” & 1
  8. Print 3 ; “AB” ; 1
  9. Print 3 , “AB” , 1
  10. Print 4 ; “AB”
  11. Print 1 ; 2
  12. Print 1 , 2
  13. Print str(2) , 2
  14. Discuss the functionality of Len, Left, Right, Mid, InStr, Tab, FormatNumber, and FormateCurrency functions. Give example for using each of them separately or mixed. Example: right(left(“abcd”,2),1) , len(left(“abcdefgh”,4)) … etc
  15. what is the result of int(rnd*15)+7?

21.Which of the following is an invalid filename

  1. home; work1.doc
  2. [homework1].txt
  3. Homework*2.xls
  4. 2.home,work.txt
  5. All of the above

22.Which of the following is an invalid filespec

  1. C:\temp#\data.pdf
  2. A:\VisualBasic\cs116\
  3. \Temp\data.pdf
  4. 1 and 2
  5. All of the above

23.What s wrong with the filespec

C$:\program files\MS$office\winword.exe

  1. $ is not allowed in a file or folder name
  2. .exe is an invalid extension
  3. $ is not allowed in a drive name
  4. Options 1 and 3 are correct
  5. All of the above

24.Which of the following statement is true

  1. The maximum number of characters allowed in an object name is 255
  2. The maximum number of characters allowed in an object name is 45
  3. The maximum number of characters allowed in an file name is 255
  4. The maximum number of characters allowed in an variable name is 215
  5. The maximum number of characters allowed in an filename name is 215

25.Visual Basic 6.0 is a

  1. High level language
  2. Object oriented language
  3. Even driven language
  4. A GUI language
  5. All of the above

26. You to press ……… to activate the properties window

  1. Alt+F4
  2. Ctrl+F4
  3. Tab
  4. Shift+Ctrl+F
  5. Alt/V/W

27.Identify the error in the following code?

Private Sub txtSubmit_Click()

txtPhrase.font.Name “Courier New”

End Sub

  1. txtSubmit is a text box and doesn’t have a “Click” event
  2. “Cowries New” misspelled
  3. txtSubmit is an invalid button name
  4. The assignment statement is missing an equal sign
  5. 2 and 3

28.For the following code segment which choice is the more correct?

Private Sub cmdSubmit_Click()

txtPhrase.Font = “Courier New”

End Sub

  1. Changes the text box’s font to “Courier New”
  2. Changes the command button font to command
  3. Changes the textbox text to read “Courier New”
  4. Wrong! But the complier will change the font because Name is the default property for Font
  5. The Complier will display “ Incorrect Use of Property”

29.What is wrong with the following event procedure?

Private Sub cmd_Click()

txtPhrase.Font.Italic = “Italic”

EndSub

  1. The button has no Name!
  2. No space between End and Sub
  3. “Italic” is an invalid Assignment
  4. nothing
  5. 2, 3

30.What is the outcome of with the following code?

Name = “Terminal”

  1. Assign the string constant “Terminal” to the string variable Name
  2. Changes the editor font to “Terminal”
  3. Terminal is a reserved word
  4. Name is an invalid variable name and the code won’t run
  5. Font is missing from property name

31.Determine the output of the following code?

a = 2

b = 3

c = b^3 + a /2

picDisplay.Print c, C, b

  1. 14C27
  2. cCb
  3. 2803
  4. 28283
  5. 14143

32. Determine the output of the following code?

a = 2

b = a*a^2/(4-2)

c = 64/a^3+2

picDisplay.Print b; tab(8); c

  1. 4 2
  2. 4 10
  3. 0 10
  4. 10 4
  5. 0 0

33.What is the output if we double click the cmdSubmit?

Private Sub cmdSubmit_Click()

a= (2 +3 * 4)/2

picOutput.print “a”, a

EndSub

  1. a 10
  2. 7 7
  3. a 7

a 7

  1. non of the above
  2. a 7 7

34.What is the value displayed by the textbox and picture after we press the letter “k” once? assume the textbox was empty to begin with

Private Sub txtBox_KeyPress(KeyAscii As Integer)

picDisplay.Print Chr(KeyAscii)

KeyAscii = 0

End Sub

  1. k ,k
  2. k,0
  3. 0,k
  4. ,k
  5. k, 107