Name:     ID: 
 
    Email: 

CS215 Final Exam

Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

1. 

Which of the following loop structures always executes at least once?
a.
pretest
b.
posttest
c.
top-driven
d.
None of these
 

2. 

According to the following code how many times will the loop be executed?

Dim intStart, intStop, intStep, intNumber as integer
intStart = 1
intStop = 8
intStep = 2
For intNumber = intStart to intStop Step intStep
     .
     .
Next intNumber
a.
1
b.
2
c.
3
d.
4
 

3. 

The symbol used to identify a decision on a flowchart is the _____ symbol.
a.
diamond
b.
rectangle
c.
oval
d.
parallelogram
e.
hexagon
 

4. 

The following instruction is an example of a(n) _____.
intNumber = intNumber + Amount
a.
Accumulator
b.
Counter
c.
Initializer
d.
None of these
 

5. 

If the programmer wants to protect the original variable data the programmer should pass the data by _____.
a.
reference
b.
value
c.
both a & b will protect the data
d.
None of these
 

6. 

When passing data to a user-defined function it may be passed by _________.
a.
reference
b.
value
c.
Both reference and value
d.
None of these.
 

7. 

To insert a pet type of "parakeet" into a ListBox collection called PetsListBox at the last slot when "dog", "cat", and "horse" already exist would be ___________.
a.
Me.PetsListBox.Items.Insert(4, "parakeet")
b.
Me.PetsListBox.Items.Insert(0, "parakeet")
c.
Me.PetsListBox.Items.add("parakeet")
d.
None of these
 

8. 

The ____________ method allows a programmer the control to display a form object on the screen.
a.
ShowScreen( )
b.
ShowDialog( )
c.
ShowPanel( )
d.
None of these
 

9. 

To determine how a variable is passed you must look at the _____ statement.
a.
Call
b.
Procedure Footer
c.
Dim
d.
Procedure Header
e.
None of these
 

10. 

The number of characters contained in a string can be determined by using a string's _____ property.
a.
Width
b.
Length
c.
NumChars
d.
None of these
 

11. 

The data for salary is entered with both dollar symbol and space; which instructions will remove the dollar symbol?
a.
TrimStart("$")
b.
Trim("$")
c.
TrimEnd("$")
d.
both a and b
e.
None of these
 

12. 

Which of the following will remove the trailing blanks from a variable strFirstName?
a.
LTrim(strFirstname)
b.
RTrim(strFirstName)
c.
Remove.Blanks(strFirstname)
d.
None of these
 

13. 

Assume that a textbox named PhoneNumberTextBox appears on the form, and contains the phone number 414-555-5555.  What value will display for the length of the phone number text box?
a.
10
b.
12
c.
18
d.
None of these
 

14. 

Which of the following methods will allow data to be added to an existing data file?
a.
OpenText
b.
CreateText
c.
AppendText
d.
None of these
 

15. 

Which is the appropriate function when ten blank spaces need to be inserted?
a.
Blanks(10)
b.
Space(10)
c.
Insert(10)
d.
None of these
 

16. 

The method that most easily accommodates right justification of data is the _____ method.
a.
Space
b.
PadLeft
c.
PadRight
d.
None of these
 

17. 

Which of the following system date examples will display just the current month?
a.
Today.Month
b.
Today
c.
Today.ToStringMonth("MMMM")
d.
None of these
 

18. 

To print data on the printer you use the _____ method.
a.
e.Print.Graphics
b.
e.Graphics.Print
c.
e.Graphics.DrawString
d.
None of these
 

19. 

The instruction required to open a data file for input called report.txt is __________.
a.
objStreamReader=System.IO.File.OpenText("report.txt")
b.
System.IO.File.Exists("report.txt")
c.
objStreamReader.ReadLine()
d.
objStreamReader.Close()
e.
None of these
 

20. 

Which of the following correctly represents the hierarchy of terms from largest aggregate of data to smallest?
a.
file, field, record
b.
field, record, file
c.
file, record, field
d.
record, file, field
 

21. 

To create a record structure for a file layout you would use the _____ statement.
a.
record
b.
structure
c.
define
d.
field
 

22. 

The number of bytes in a record structure can be determined by using the _____ function.
a.
width
b.
len
c.
type
d.
None of these
 

23. 

In the statement FilePut(4, udtStudent, 3), what record number is being written?
a.
4
b.
3
c.
2
d.
1
 

24. 

Which of the following is the first step in the typical use of a random file in a program?
a.
Declare a record
b.
Open a file
c.
Read or write data as necessary from the file
d.
Close a file
e.
Create the record structure
 

25. 

A random data file record layout might be more easily identified if the user assigned name contained which of the following phrases?
a.
Random
b.
Struc
c.
Rand
d.
None of these
 

26. 

Consider the following array. What is the subscript value for Lake Huron?

Huron
Ontario
Michigan
Erie
Superior
a.
1
b.
2
c.
3
d.
4
e.
None of the these
 

27. 

The following statement will declare an array that has how many elements?

Dim strLakes(5)
a.
4
b.
5
c.
6
d.
None of these
 

28. 

A local array can be declared using the accessibility keyword _____.
a.
Local
b.
Dim
c.
Private
d.
None of these
 

29. 

To arrange the elements in an array in ascending order you use the _____ method.
a.
Array.Arrange( )
b.
Array.Reverse( )
c.
Array.Sort( )
d.
None of these
 

30. 

If an array is sorted in descending order, what index value is the largest element located?
a.
0
b.
1
c.
n
d.
n-1
e.
None of these
 

Essay
 

31. 

Differentiate between a pretest and posttest loop structure.
 

32. 

Explain the difference between passing data by value and by reference.
 

33. 

Explain how records in a sequential data file are retrieved and processed.
 

34. 

Why is it necessary to confirm with the user his or her intent to initialize the data file?
 

35. 

Explain the difference between LTrim and RTrim.
 



 
Submit          Reset Help