First Exam Review Questions
Prepared by:Dr. Wael Mardini, updated by Dr. Monther Aldwairi,
Note: the exam questions will be in multiple choice form.
- Define each of the following ALU, BASIC, RAM, ROM, and GUI.
- What is machine language?
- What is the purpose of the Form Layout Window in VB?
- How you know that a line is a comment line? Hint: the first character in the line
- What is the difference between Name and Caption properties of an object?
- What are the initials used in naming the objects text box, label, picture box?
- How you represent a string constant? Hint: first and last character should be “
- 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”))
- What is the difference between drag and hover is using the mouse?
- Give an example of each of the following:
- Flowchart
- Psedocode
- Hierarchy chart
- Discuss the steps of the program development cycle, and their order importance.
- Which of the following is considered as an input tool, or an output one or both?
- Picturebox: for output
- Textbox:for input & output
- Label: for output
- Inputbox: for input
- How to change the font style and the size of the text within the code.
Example:
Text1.Font.Size=14
Text1.Font.Bold=True
- Mention the rules of naming variables in VB. Give examples of valid and invalid names.
- What is the default name of a label, command buttons, picture box, textbox, etc.
Text1, Text2,….. for textboxes
Command1, command2,…. For command buttons. … etc
- What is the purpose of the Chr, Val, Asc, and Str functions? Give examples.
- How to clear the pictureboxes, textboxes, and labels?
Text1.Text=””
Label1.Caption=””
Picture1.Cls
- What is the output of the following Code:
- Print “AB” & “CD”
- Print “AB”; ”CD”
- Print “AB” , “CD”
- Print “AB” & 1
- Print “AB” ; 4
- Print 3 & “AB” & 1
- Print 3 ; “AB” ; 1
- Print 3 , “AB” , 1
- Print 4 ; “AB”
- Print 1 ; 2
- Print 1 , 2
- Print str(2) , 2
- 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
- what is the result of int(rnd*15)+7?
21.Which of the following is an invalid filename
- home; work1.doc
- [homework1].txt
- Homework*2.xls
- 2.home,work.txt
- All of the above
22.Which of the following is an invalid filespec
- C:\temp#\data.pdf
- A:\VisualBasic\cs116\
- \Temp\data.pdf
- 1 and 2
- All of the above
23.What s wrong with the filespec
C$:\program files\MS$office\winword.exe
- $ is not allowed in a file or folder name
- .exe is an invalid extension
- $ is not allowed in a drive name
- Options 1 and 3 are correct
- All of the above
24.Which of the following statement is true
- The maximum number of characters allowed in an object name is 255
- The maximum number of characters allowed in an object name is 45
- The maximum number of characters allowed in an file name is 255
- The maximum number of characters allowed in an variable name is 215
- The maximum number of characters allowed in an filename name is 215
25.Visual Basic 6.0 is a
- High level language
- Object oriented language
- Even driven language
- A GUI language
- All of the above
26. You to press ……… to activate the properties window
- Alt+F4
- Ctrl+F4
- Tab
- Shift+Ctrl+F
- Alt/V/W
27.Identify the error in the following code?
Private Sub txtSubmit_Click()
txtPhrase.font.Name “Courier New”
End Sub
- txtSubmit is a text box and doesn’t have a “Click” event
- “Cowries New” misspelled
- txtSubmit is an invalid button name
- The assignment statement is missing an equal sign
- 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
- Changes the text box’s font to “Courier New”
- Changes the command button font to command
- Changes the textbox text to read “Courier New”
- Wrong! But the complier will change the font because Name is the default property for Font
- 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
- The button has no Name!
- No space between End and Sub
- “Italic” is an invalid Assignment
- nothing
- 2, 3
30.What is the outcome of with the following code?
Name = “Terminal”
- Assign the string constant “Terminal” to the string variable Name
- Changes the editor font to “Terminal”
- Terminal is a reserved word
- Name is an invalid variable name and the code won’t run
- 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
- 14C27
- cCb
- 2803
- 28283
- 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
- 4 2
- 4 10
- 0 10
- 10 4
- 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
- a 10
- 7 7
- a 7
a 7
- non of the above
- 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
- k ,k
- k,0
- 0,k
- ,k
- k, 107