View Results


FinalExam
Name: Kwee Tan Attempt: 1 / 1 Out of: 40
Started: December 12, 2005 9:57am Finished: December 12, 2005 11:09am Time spent: 1 hr, 12 min., 38 sec.
Student finished 47 min. 22 sec. ahead of the 120 min. time limit.

Question 1  (1 point)
What is the equality operator?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. !=
0.0% b. =
100.0% Correct Response Student Response c. ==
0.0% d. &
0.0% e. +
Score:1 / 1
Question 2  (1 point)
Which method is used to find the occurence of a string in a regular expression?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Finds
0.0% b. Occurence
100.0% Correct Response Student Response c. Matches
0.0% d. Regex
0.0% e. Expression
Score:1 / 1
Question 3  (1 point)
mscorlib is:

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. a class
0.0% b. a package
100.0% Correct Response Student Response c. an assembly
0.0% d. a namespace
0.0% e. a method
Score:1 / 1
Question 4  (1 point)
Which statement correctly sets up a foreach loop to be used with a SortedList?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. foreach (SortedList sl in mySortedList)
0.0% b. foreach (List li in mySortedList)
0.0% c. foreach (Entry en in mySortedList)
0.0% d. foreach (Object o in mySortedList)
100.0% Correct Response Student Response e. foreach (DictionaryEntry de in mySortedList)
Score:1 / 1
Question 5  (1 point)
A switch statement can be used to test which of these variable types?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. int
0.0% b. char
0.0% c. string
0.0% d. only a and b
100.0% Correct Response Student Response e. a, b, and c are correct
Score:1 / 1
Question 6  (1 point)
Which class would you use to find out the path name or directory name of a file?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response a. Path class
0.0% Student Response b. FileInfo class
0.0% c. SystemInfo class
0.0% d. PathInfo class
0.0% e. DirctoryInfo class
Score:0 / 1
Question 7  (1 point)
int x; 
switch (x)
{
    
}

If x were 3, which statement would you place in the switch to find a match for 3?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. 3:
100.0% Correct Response Student Response b. case 3:
0.0% c. case "3":
0.0% d. case '3':
0.0% e. case 3;
Score:1 / 1
Question 8  (1 point)
Which statement about enums is true?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Double is the default datatype.
0.0% b. The datatype must be float or double.
100.0% Correct Response Student Response c. The datatype must be integral (int or long).
0.0% d. Enums have string as the default datatype.
0.0% e. Enums are not supported in C#.
Score:1 / 1
Question 9  (1 point)
.NET is supported on non-Windows platforms. (True/ False)

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. True
100.0% Correct Response Student Response b. False
Score:1 / 1
Question 10  (1 point)
class Customer
{
      public int acctNumber;
      public string firstName;
      public string lastName;

}

lastName is ________________.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. a class variable
100.0% Correct Response Student Response b. an instance variable
0.0% c. a constant
0.0% d. a method
0.0% e. an enumeration
Score:1 / 1
Question 11  (1 point)
A groupBox control named groupBox1 does not appear on the Windows form. Which statement should be added to the code so that it does appear?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Controls.Add(groupBox1);
0.0% b. this.Add(groupBox1);
0.0% c. Add(groupBox1);
100.0% Correct Response Student Response d. this.Controls.Add(groupBox1);
0.0% e. groupBox1.add();
Score:1 / 1
Question 12  (1 point)
In which class would you find methods to round, calculate the square root, and find the absolute value of a number?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a. Math
0.0% b. Environment
0.0% c. Path
0.0% d. File
0.0% e. System
Score:1 / 1
Question 13  (1 point)
To get the name of a file from the user, you can use which class?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a. SaveFileDialog
0.0% b. NewFileDialog
0.0% c. SaveFile
0.0% d. FileDialog
0.0% e. SaveDialog
Score:1 / 1
Question 14  (1 point)
Which statement tests if a radioButton has been selected?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a. if (radioButton1.Checked == true)
0.0% b. if (radioButton1.Item == true)
0.0% c. if (radioButton1.Value == true)
0.0% d. if (radioButton1.Selected == true)
0.0% e. if (radioButton1.Text == true)
Score:1 / 1
Question 15  (1 point)
Customer c = new Customer(); The statement is an example of _________________.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. inheritance
0.0% b. encapsulation
0.0% c. variable declaration
0.0% d. obfuscation
100.0% Correct Response Student Response e. instantiation
Score:1 / 1
Question 16  (1 point)
C# does not allow overloaded constructors.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. True
100.0% Correct Response Student Response b. False
Score:1 / 1
Question 17  (1 point)
Which method can be used to delete a record from a database?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Execute method of the Command object
0.0% b. Delete method of the DataAdapter object
0.0% c. Execute method of the DataAdapter object
100.0% Correct Response Student Response d. ExecuteNonQuery method of the Command object
0.0% e. ExecuteNonQuery method of the Connection object
Score:1 / 1
Question 18  (1 point)
The params keyword _______________________.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. defines a method's return type.
0.0% b. lets a method pass by value.
0.0% c. overrides a method signature.
100.0% Correct Response Student Response d. lets a method accept any number of arguments.
0.0% e. does not exist in C#.
Score:1 / 1
Question 19  (1 point)
Suppose you had a class named Dog. How could you compare two Dog objects to see if they were equal?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. implement the CompareTo method of the Object class
0.0% b. use the Equals method of the Object class
100.0% Correct Response Student Response c. implement the IComparable interface in the Dog class
0.0% d. Use the = = operator to compare the objects
0.0% e. use the CompareTo method of the Object class
Score:1 / 1
Question 20  (1 point)
Serializing an object using the BinaryFormatter saves private, as well as public fields. (True/False)

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a. True
0.0% b. False
Score:1 / 1
Question 21  (1 point)
What is a good way to allow a program to dynamically read in values at startup, for instance, the name of a database.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. use an Environment Variable file
100.0% Correct Response Student Response b. use an Application Configuration file
0.0% c. use a Serialization file
0.0% d. use a System Thread
0.0% e. use an ArrayList
Score:1 / 1
Question 22  (1 point)
You can define your own exception class, as long as it is derived from the ____________ class.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% Student Response a. Exception
0.0% b. RunTimeException
100.0% Correct Response c. ApplicationException
0.0% d. UserDefinedException
0.0% e. SpecialException
Score:0 / 1
Question 23  (1 point)
An interface _____________

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a. contains only abstract methods.
0.0% b. can contain abstract and concrete methods.
0.0% c. contains only concrete methods
Score:1 / 1
Question 24  (1 point)
Which class can be used to create a dyamic array?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. LinkedList
0.0% b. Stack
0.0% c. Queue
0.0% d. Array
100.0% Correct Response Student Response e. ArrayList
Score:1 / 1
Question 25  (1 point)
Which code correctly declares an array that can hold floating point (decimal) numbers?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
100.0% Correct Response Student Response a.
int arraySize = 10;
double[] arrA = new double[arraySize];
0.0% b.
int arraySize = 10;
int[] arrA =  double[array];
0.0% c.
int Size = 10;
[double] arrA = new double[arraySize];
0.0% d.
int x = 10;
double arrA = new double[arraySize];
0.0% e.
double arraySize = 10.0;
double arrA = new double[arraySize];
Score:1 / 1
Question 26  (1 point)
Which is the AND operator? 

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. +
0.0% b. AND
0.0% c. ||
100.0% Correct Response Student Response d. &&
0.0% e. @
Score:1 / 1
Question 27  (1 point)
Which statement is needed to use regular expressions in your program?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. using Text.RegularExpressions ;
0.0% b. using System.Text.RegEx ;
0.0% c. using System.RegularExpressions ;
0.0% d. using Sytem.Text;
100.0% Correct Response Student Response e. using System.Text.RegularExpressions ;
Score:1 / 1
Question 28  (1 point)
Which method is used to place a node on a stack?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Queue method of ArrayList class
0.0% b. Peek method of Stack class
0.0% c. Push method of Queue class
100.0% Correct Response Student Response d. Push method of Stack class
0.0% e. Enqueue method of Stack class
Score:1 / 1
Question 29  (1 point)
Structures (structs) support inheritance.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. True
100.0% Correct Response Student Response b. False
Score:1 / 1
Question 30  (1 point)
Which statement is true concerning serialization?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. only public methods are serializable
0.0% b. neither private nor public fields are serializable
0.0% Student Response c. private and public fields are serializable
0.0% d. only private fields are serializable
100.0% Correct Response e. only public fields are serializable
Score:0 / 1
Question 31  (1 point)
ADO.NET supports which databases?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. Oracle
0.0% b. SQL Server
0.0% c. Access
0.0% d. only B and C are correct
100.0% Correct Response Student Response e. A, B, and C are correct
Score:1 / 1
Question 32  (1 point)
Which statement correctly declares a structure? (choose one answer)

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. public structure Person
0.0% b. public enum Person
0.0% c. public class Person
0.0% d. public interface Person
100.0% Correct Response Student Response e. public struct Person
Score:1 / 1
Question 33  (1 point)
Which foreach statement is correct to loop through an array of Cartoon objects named arrayOfCartoons?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. foreach (arrayOfCartoons)
0.0% b. foreach (Cartoon[] cc in arrayOfCartoons[])
0.0% c. foreach (Cartoon cc[] in arrayOfCartoons)
0.0% d. foreach (Cartoon[] cc in arrayOfCartoons)
100.0% Correct Response Student Response e. foreach (Cartoon cc in arrayOfCartoons)
Score:1 / 1
Question 34  (1 point)
The DataAdapter object is read only. (True/ False)

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. True
100.0% Correct Response Student Response b. False
Score:1 / 1
Question 35  (1 point)
_________ accepts a method name as its input parameter and invokes the method.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. An iterator
0.0% b. An identifier
100.0% Correct Response Student Response c. A delegate
0.0% d. An interface
0.0% e. An event
Score:1 / 1
Question 36  (1 point)
Which statement correctly adds the string "Joe" to a listbox named listBox1?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. listBox1.Add("Joe");
0.0% b. listBox1.AddItem("Joe");
0.0% c. listBox1.AddString("Joe");
0.0% d. listBox1.Items("Joe");
100.0% Correct Response Student Response e. listBox1.Items.Add("Joe");
Score:1 / 1
Question 37  (1 point)
C# supports which looping structures.

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. for
0.0% b. do
0.0% c. while
0.0% d. only a and b
100.0% Correct Response Student Response e. a, b, and c are correct
Score:1 / 1
Question 38  (1 point)
Which statement shows the correct signature for a button click event method?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. private void button1_Click(object sender, System.Button.EventArgs e)
0.0% b. private void button1_Click(object sender, System.MouseEventArgs e)
0.0% c. private void button1_Click(object sender)
100.0% Correct Response Student Response d. private void button1_Click(object sender, System.EventArgs e)
0.0% e. private void button1_Click(System.EventArgs e)
Score:1 / 1
Question 39  (1 point)
System.Drawing is:

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. a method
0.0% b. a class
100.0% Correct Response Student Response c. a namespace
0.0% d. a structure
0.0% e. an enum
Score:1 / 1
Question 40  (1 point)
Which class provides methods to create and manipulate strings?

Student response:
Percent
Value
Correct
Response
Student
Response
Answer Choices
0.0% a. StringTokenizer
100.0% Correct Response Student Response b. StringBuilder
0.0% c. TextBuilder
0.0% d. Text
0.0% e. Path
Score:1 / 1
Total score: 37 / 40 = 92.5%