0% found this document useful (0 votes)
74 views

There Is No Limit

The document discusses various concepts related to object-oriented programming and C# programming. It provides true/false questions and multiple choice questions about topics like arrays, data types, variables, methods, classes, namespaces, errors, and the software development process.

Uploaded by

Tony Sanchez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

There Is No Limit

The document discusses various concepts related to object-oriented programming and C# programming. It provides true/false questions and multiple choice questions about topics like arrays, data types, variables, methods, classes, namespaces, errors, and the software development process.

Uploaded by

Tony Sanchez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

there is no limit

What is the largest dimension an array can be declared to store values?


a. 10
b. 100
c. 3
d. 5
e. there is no limit

Logic
You run a program and it gives you the difference of two values as the output,
instead of the sum of the values, as intended. This is what type of error?

Compiler
The program that translates high-level programming language into machine-
readable form is a ______________.

Design the solution before coding


The following strategy reduces the amount of time in development and
produces more efficient solutions:
a. Code the solution as soon as possible
b. Design the solution before coding
c. Analyze the solution before testing and debugging
d. Build a prototype during testing
e. Use a simple, low-level language for development

Analysis
In which phase of the software development process would probing questions
be used to verify the problem definition?
a. analysis
b. design
c. coding
d. implementation
e. testing

Iterative development
Cycling back to previous phases as potential problems are uncovered is an
example of:
a. object-oriented programming
b. stepwise refinement
c. Intermediate Language
d. iterative development
e. structured programming

Desk check the solution


After designing your solution, you should ________________ before typing any
code.
a. analyze the problem definition
b. check for run-time errors
c. do maintenance on the solution
d. desk check the solution
e. determine what .NET class to use

Characteristics or behaviors
With the object-oriented methodology, the data members are referred to as
attributes and actions, or:
a. attributes or characteristics
b. characteristics or behaviors
c. methods or attributes
d. behaviors or methods
e. attributes or behaviors

All of the above


.NET is considered a powerful development environment because:
a. It contains over 2000 classes.
b. Solutions can be developed using different programming languages.
c. Windows applications can be developed easily.
d. Component-based development is possible.
e. All of the above.

Web
ASP.NET creates which type of application?
a. Windows
b. console
c. command
d. Web
e. services

/* // ///
Which BEGINNING symbol(s) indicates the following lines will be comments?
a. /*
b. **
c. //
d. ///
e. */

namespace
System is an example of:
a. object
b. class
c. method
d. namespace
e. directive

namespace
A(n) ______________ groups semantically related types under a single name.
a. object
b. class
c. method
d. namespace
e. directive

{}
To mark the beginning and end of a block of code, C# programmers use:
a. [ ]
b. { }
c. ( )
d. begin end
e. start stop

using
Which of the following is a keyword?
a. Main( )
b. System
c. using
d. WriteLine
e. all of the above

System.Console.Read( )
The fully qualified call to the method that allows the user to input a single
character is:
a. Console.System.Read( )
b. System.Console.Read( )
c. Console.System.Write( )
d. System.Console.Write( )
e. System.Console.ReadLine( )

Prototype
A(n) ______________ is a mock-up of desired output.
a. prototype
b. algorithm
c. diagram
d. specification
e. none of the above

IntelliSense
What is the name of the feature in Visual Studio that displays in a scrollable list
all available methods and properties when the dot is typed after an object
name?
a. Help
b. Rotor
c. Mono
d. IntelliSense
e. ToolTip

Compile
To see the results of an application, you ______________ the code.
a. compile
b. JIT
c. execute
d. edit
e. desk check

\n
Which escape sequence can be used to indicate the cursor should advance to
the next line?
a. newline
b. escape next
c. \n
d. newline
e. \r

Console.Write("ok");
Which of the following is a call to a method?
a. Console.Write;
b. Console.Write["ok"];
c. Write.Console("ok");
d. Console.Write("ok");
e. none of the above

exampleOfaValue
Which of the following is a valid identifier?
a. namespace
b. variable 1
c. exampleOfaValue
d. 3value
e. value#1

Integral
The number 768 is an example of a _____________ type.
a. bool
b. integral
c. floating-point
d. struct
e. decimal

string
Which of the following is a reference type?
a. int
b. bool
c. string
d. decimal
e. integral

all of the above


The character that CANNOT be used with an identifier is:
a. --
b. $
c. *
d. #
e. all of the above

int
Which of the following is a reserved keyword?
a. Console
b. data
c. int
d. System
e. all of the above

double does not require suffixing a numeric literal with a value such as m
or f
One of the primary differences between float, double, and decimal is:
a. float is used to represent more significant digits
b. double is normally used with large monetary values
c. decimal is not used to display negative values
d. double does not require suffixing a numeric literal with a value such as m or f
e. decimal is primarily used to represent small monetary values that require a $
for formatting.

string bookName;
Which of the following is a valid declaration for a variable to store the name of
this textbook?
a. string name of book;
b. char nameOfBook;
c. boolean nameOfBook;
d. string bookName;
e. char book Name;

classes
Types are implemented in C# using:
a. classes
b. types
c. objects
d. namespaces
e. programs

47
An object of the int class is:
a. 47.98
b. 47
c. int class
d. type object
e. type integral

bool upperLimit;
What would be an appropriate declaration for a memory location to be used as
a flag to indicate whether a value has reached its upper limit?
a. int upperLimit;
b. upperLimit reached;
c. bool upperLimit;
d. Boolean upperLimit;
e. string upperLimit;

places a value in memory that cannot be changed


Adding the keyword const to a declaration:
a. places a value in memory that cannot be changed
b. declares variables of the constant type
c. must be done by placing it after the identifier in the declaration
d. can only be done with the integral types
e. is prohibited in C#

result += 15;
Which statement increases the result by 15?
a. 15 += result;
b. 15 =+ result;
c. result =+ 15;
d. result += 15;
e. result = 15 +;

8
What is stored in ans as a result of the arithmetic expression, given the
following declarations?

int ans = 0, v1 = 10, v2 = 19;


ans = --v2 % v1++;

a. 1.8
b. 9
c. 8
d. 2
e. none of the above

28
What is stored in ans as a result of the arithmetic expression, given the
following declarations?

int ans = 10, v1 = 5, v2 = 7, v3 = 18;


ans += v1 + 10 * (v2-- / 5) + v3 / v2;

a. 18
b. 32
c. 28
d. 30
e. none of the above

all of the above


Which of the following formats 86 to display with two digits to the right of the
decimal?
a. {0:C}
b. {0:c}
c. {0:f2}
d. all of the above
e. none of the above

intValue _value1 AVALUE


Which of the following are valid identifiers?
a. intValue
b. value#1
c. the first value
d. _value1
e. AVALUE

methods
Functions or modules found in other languages are similar to ____________ in
C#.
a. modifiers
b. parameters
c. arguments
d. methods
e. classes

void
Which of the following is placed in a method heading to indicate that no value
will be returned?
a. public
b. static
c. arguments
d. void
e. return

private
Which of the following modifiers is the most restrictive?
a. private
b. static
c. public
d. internal
e. protected

PrintReport
Which of the following identifiers follows the standard naming convention for a
method?
a. Calculate Final Grade
b. MilesPerGallon
c. InValueMethod
d. PrintReport
e. Method1
answer = Math.Floor(87.2);
Which of the following would be the most appropriate way to invoke the
predefined Floor( ) method found in the Math class?

public static double Floor(double)

a. answer = Floor(87.2);
b. answer = Math.Floor(87.2);
c. Floor(87.2);
d. Math.Floor(double);
e. Math.Floor(87.2);

public int DetermineAnswer(double v1, int v2)


Given the following statement, what would be the best heading for the
DetermineAnswer( ) method?

int aValue, result;


result = DetermineAnswer(27.83, aValue);

a. public void DetermineAnswer(27.83, aValue);


b. public int DetermineAnswer( );
c. public int DetermineAnswer(double v1, int v2);
d. public double int DetermineAnswer( );
e. public void DetermineAnswer(double v1, int v2);
back to the location in the calling method that made the call
After completing the called method's body, control is returned:
a. back to the location in the calling method that made the call
b. to the last statement in the method that made the call
c. to the first statement in the method that made the call
d. to the Main( ) method
e. to the method that is listed next in the printed source code

DetermineHighestScore(val1, val2);
Which of the following is a valid method call for DetermineHighestScore?

void DetermineHighestScore(int val1, int val2)

a. void DetermineHighestScore(int val1, int val2)


b. DetermineScore(int val1, int val2)
c. DetermineHighestScore(val1, val2)
d. DetermineHighestScore(2, 3.5)
e. GetHighestScore( )

public SetNoOfSquareYards(double)
What is the signature of the following method?

public void SetNoOfSquareYards(double squareYards)

a. public void SetNoOfSquareYards(double squareYards)


b. public SetNoOfSquareYards(double squareYards)
c. SetSetNoOfSquareYards
d. public SetNoOfSquareYards(double)
e. SetNoOfSquareYards(double)

local variables
Variables needed only inside a method should be defined as
_______________.
a. private member data
b. local variables
c. properties
d. arguments
e. parameters

public static int ComputeCost(double aValue)


Given the call to the method ComputeCost( ) shown below, which of the
following would be the most appropriate heading for the method? The variable
someValue is declared as an int.

someValue = ComputeCost(27.3);

a. public static void ComputeCost(double aValue)


b. public static int ComputeCost( )
c. public static double ComputeCost(int someValue)
d. public static int ComputeCost(double aValue)
e. public static int ComputeCost(int aValue)

call to a void method


The following is probably an example of a _______________.

DisplayInstructions( );

a. call to a value-returning method


b. call to a void method
c. method heading
d. method definition
e. call to a method with multiple arguments

follow the Camel case convention


If you follow the standard C# naming conventions, the local variable names:
a. follow the Camel case convention
b. should use an action verb phrase
c. begin with an uppercase character
d. are named like namespace identifiers
e. are defined inside parenthesis of the method header

InitializeValues( );
Which of the following would be a valid call to a method defined as shown
below?

public static void InitializeValues( )


a. void InitializeValues( );
b. Console.WriteLine( InitializeValues( ) );
c. int returnValue = InitializeValues( );
d. InitializeValues( );
e. InitializeValues(aVariable);

someIntValue = GetData(out aValue, ref bValue);


Given the following method definition, what would be a valid call? The variable
someIntValue is defined as an int.

public static int GetData(out int aValue, out ref bValue)

a. someIntValue = GetData(aValue, bValue);


b. someIntValue = GetData(out aValue, ref bValue);
c. someIntValue = GetData(out, ref);
d. someIntValue = GetData(int out aValue, int ref bValue);
e. GetData(out aValue, ref bValue);

int
Which of the following is NOT a modifier in C#?
a. int
b. private
c. public
d. static
e. protected

classes
Objects are instances of __________.
a. data members
b. parameters
c. properties
d. methods
e. classes

public
Properties are defined with _____________ access mode.
a. public
b. static
c. private
d. void
e. protected

private
Which of the following modifiers is the most restrictive?
a. private
b. static
c. public
d. internal
e. protected
Employee
Which of the following identifiers follows the standard naming convention for
naming a class?
a. Calculate Final Grade
b. MilesPerGallon
c. Students
d. Reports
e. Employee

answer = gradStudent.CalculateAvg(87.2, 90);


Which of the following would be the most appropriate way to invoke the
CalculateAvg( ) method found in the Student class if an object named
gradStudent had been instantiated from the class?

public double CalculateAvg(double, double)

a. gradStudent = CalculateAvg(87.2, 90);


b. answer = Student.CalculateAvg(87.2, 90);
c. CalculateAvg(87.2, 90);
d. answer = gradStudent.CalculateAvg(double, double);
e. answer = gradStudent.CalculateAvg(87.2, 90);

CalculateAvg( )
Which of the following is one of the user-defined methods inherited from the
object class?
a. ToString( )
b. Main( )
c. CalculateAvg( )
d. EqualsHashCode( )
e. TypeHashCode( )

data, behavior
Properties are associated with the ___________ of the class while methods are
affiliated with the ____________ of the class.
a. activity, fields
b. accessors, mutators
c. objects, instances
d. data, behavior
e. behavior, data

int CalculateAverage(int val2, int val1)


Which of the following is a valid overloaded method for CalculateAverage( )?

int CalculateAvg(int val1, int val2)

a. void CalculateAvg(int val1, int val2)


b. int CalculateAvg(int val1, int val2)
c. int CalculateAvg(double val1, double val2)
d. double CalculateAvg(int val1, int val2)
e. int CalculateAvg(int val2, int val1)
new
What operator is used to instantiate the class?
a. method
b. plus symbol
c. ToString( )
d. new
e. equal symbol

properties
Instance variables are the same as:
a. private member data
b. local variables
c. properties
d. arguments
e. parameters

public Employee( )
Given the Employee class shown below, which of the following would be the
most appropriate heading for its default constructor?

public class Employee {

a. public void Employee( )


b. public Employee( )
c. public static Employee( )
d. private void Employee( )
e. private Employee( )

accessor
The following is probably an example of a(n) ____________.

public double GetYards( )

a. constructor
b. mutator
c. property
d. accessor
e. class definition

Name
If you follow the standard C# naming conventions, the property name for the
following instance variable would be:

private string name;

a. propertyName
b. nameProperty
c. getName
d. name
e. Name
Employee employee1 = new Employee( );
Which of the following would be a valid call to the default constructor for the
following class?

public class Employee {

a. Employee employee1 = new Employee( );


b. Employee employee1 = new undergrad( );
c. Employee employee1;
d. Employee employee1 = new Employee(default);
e. not enough information

public void SetGpa(double gpaValue)


Given the following class definition, what would be a valid heading for a
mutator?

public class Student {


private string name;
private double gpa; }

a. public double SetGpa(double gpaValue)


b. public void SetGpa(double gpaValue)
c. public double SetGpa( )
d. public void GetGpa(double gpaValue)
e. public double SetGpa( )

methods show the return type on the diagram


With a UML class diagram:
a. the name of the class appears at the bottom section of the diagram
b. data members show a + to indicate public access
c. methods are not shown
d. objects of the class appear in the middle section of the diagram
e. methods show the return type on the diagram

public
Which of the following modifiers in C# is used with constructors?
a. const
b. private
c. public
d. static
e. protected

private, public
Normally, member data uses a ___________ access modifier, and methods
use a ___________ access modifier for object-oriented solutions.
a. protected, public
b. private, protected
c. public, protected
d. public, private
e. private, public
override
In order to provide a new definition for the ToString( ) method, what keyword is
added to the method heading?
a. static
b. override
c. new
d. overload
e. public

true or false
The result of the expression if (aValue == 10) is:
a. true or false
b. 10
c. an integer value
d. aValue
e. determined by an input statement

a>b
Which expression is evaluated first in the following statement?

if (a > b && c == d | | a == 10 && b > a + 7)

a. a > b
b. b && c
c. d | | a
d. a + 7
e. none of the above

&&
The ____________ operator represents the logical AND.
a. ++
b. | |
c. &&
d. @
e. none of the above

used as part of an assignment operator


The symbol (=) is:
a. the operator used to test for equality
b. used for comparing two items
c. used as part of an assignment statement
d. considered a logical compound operator
e. all of the above

detracts from its readability


Incorrect use of spacing with an if statement:
a. detracts from its readability
b. causes a syntax error message
c. can change the program logic
d. causes a logic error message
e. all of the above

foreach
Which loop structure can only be used with a collection or array?
a. foreach
b. for
c. while
d. do...while
e. none of the above

do...while
If a loop body must be executed at least once, which loop structure would be
the best option?
a. foreach
b. for
c. while
d. do...while
e. none of the above

for
If a loop body uses a numeric value that is incremented by three with each
iteration through the loop until it reaches 1000, which loop structure would
probably be the best option?
a. foreach
b. for
c. while
d. do...while
e. none of the above

continue
When used with a while statement, which jump statement causes execution to
halt inside a loop body and immediately transfers control to the conditional
expression?
a. break
b. goto
c. return
d. continue
e. none of the above

while (counter < 10)


Which of the following is a valid C# pretest conditional expression that enables
a loop to be executed as long as the counter variable is less than 10?
a. do while (counter < 10)
b. while (counter < 10)
c. foreach (counter in 10)
d. none of the above
e. all of the above
integer
The value contained within the square brackets that is used to indicate the
length of the array must be a(n):
a. class
b. double
c. string
d. integer
e. none of the above

int [ ] temp = new int [7];


Which of the following array declarations would enable you to store the high
temperature for each day of one full week?
a. int temp1, temp2, temp3, temp4, temp5, temp6, temp7;
b. int temp [7] = new int [7];
c. temp int [ ] = new temp [7];
d. int [ ] temp = new int [7];
e. int [ ] temp = new temp [8];

specifies the size of the array as five


Choose the statement that does NOT apply to the following declaration:

double [ ] totalCostOfItems = {109.95, 169.95, 1.50, 89.95};

a. declares a one-dimensional array of floating-point values


b. specifies the size of the array as five
c. set the array element totalCostOfItems[1] to 169.95
d. declares an area in memory where data of double type can be stored
e. all are correct

b
Using the following declaration:

char [ ] n = {'a', 'b', 'c', 'd', 'e'};

What does n[1] refer to?


a. a
b. abcde
c. b
d. 'a'
e. none of the above

all have the same type


An array is a list of data items that _______________.
a. all have the same type
b. all have different names
c. all are integers
d. all are originally set to null ('\0')
e. none of the above
none of the above
Using the following declaration:

int [ ] x = {12, 13, 14, 15, 16, 17, 18, 19};

What does x[8] refer to?


a. 19
b. 18
c. '\0'
d. 0
e. none of the above

x[4] += 42;
Which of the following adds 42 to the element at the fifth physical spot?

int [ ] x = {12, 13, 14, 15, 16, 17, 18, 19};


a. x[5] += 42;
b. x[4] += 42;
c. x[5 + 42];
d. x = 42 + 5;
e. none of the above

3
How many components are allocated by the following statement?

double [ ] values = new double [3];


a. 32
b. 3
c. 2
d. 4
e. none of the above

anArray[2] *= 2;
If you declare an array as int [ ] anArray = new int [5]; you can double the value
stored in anArray[2] with the statement:
a. anArray[2] = anArray[5] * 2;
b. anArray = anArray * 2;
c. anArray[2] = anArray[2] 2;
d. anArray[2] *= 2;
e. none of the above

replace the 800 amount with 810


With the following declaration:

int [ ] points = {550, 700, 900, 800, 100};


The statement points[3] = points[3] + 10; will
a. replace the 800 amount with 810
b. replace the 550 amount with 560
c. replace the 900 amount with 910
d. result in an error
e. none of the above

replace the 600 with 200


With the following declaration:

int [ ] points = {300, 100, 200, 400, 600};


The statement points[4] = points[4 - 2]; will
a. replace the 400 with 2
b. replace the 300 and 600 with 2
c. replace the 600 with 200
d. result in an error
e. none of the above

display 600
With the following declaration:

int [ ] points = {300, 100, 200, 400, 600};


The statement Console.Write(points[2] + points[3]); will
a. display 200400
b. display 600
c. display "points[2] + points[3]"
d. result in an error
e. none of the above

a copy of the value in the element


When you pass a single array element to a method, the method receives:
a. a copy of the array
b. the address of the array
c. a copy of the value in the element
d. the address of element
e. none of the above

the address of each of the elements in the array


When you pass the entire array to a method, the method receives:
a. a copy of the array
b. the address of the array
c. a copy of the first value in the array
d. the address of each of the elements in the array
e. none of the above

IndexOf( )
Which method in the Array class can be used to return the index of the first
occurrence of a value in a one-dimensional array?
a. IndexOf( )
b. LastIndex( )
c. FirstIndex( )
d. Search( )
e. none of the above
result(anArray, 30);
A correct method call to a method that has the following heading would be:

int result(int[ ] anArray, int num)


a. Console.Write(result(anArray, 3));
b. result(anArray, 30);
c. Console.Write(result(anArray[ ], 3));
d. result(anArray[ ], 30);
e. none of the above
only be used for read-only access
With arrays a limitation on the foreach statement is that it can:
a. only be used for read-only access
b. only be used with integral type arrays
c. not be nested
d. only be used with arrays smaller than 1000 elements
e. not be used with dynamic arrays
all are correct
A valid call to the following method using a params parameter is:

public static void DoSomething(params int[ ] item)


a. DoSomething(4);
b. DoSomething(anArray);
c. DoSomething(4, 5, 6);
d. a and c are correct
e. all are correct
planes
When three values are contained within the square brackets, the last number
represents the number of:
a. classes
b. rows
c. planes
d. columns
e. none of the above
int [ , ] temp = new temp[7, 2];
Which of the following array declarations would enable you to store the high and
low temperatures for each day of one full week?
a. int temp[7, 2] = new int [7, 2];
b. temp int [ , ] = new temp [7, 2];
c. int [ , ] temp = new temp [7, 2];
d. int [ , ] temp = new temp[8, 3];
sets the array element totalCostOfItems[0, 1] to 169.95
Choose the statement that does NOT apply to the following declaration:

double [ , ] totalCostOfItems = { {109.95, 169.95, 1.50, 89.95}, {27.9, 18.6, 26.8,


98.5} };
a. declares a two-dimensional array of floating-point values
b. establishes the maximum number of rows as 4
c. sets the array element totalCostOfItems[0, 1] to 169.95
d. declares an area in memory where data of double type can be stored
e. all are correct
there is no limit
What is the largest dimension an array can be declared to store values?
a. 10
b. 100
c. 3
d. 5
e. there is no limit
all have the same type
A two-dimensional array is a list of data items that _____________.
a. all have the same type
b. all have different names
c. all are integers
d. all are originally set to null ('\0')
e. none of the above
values[2, 1] = 0;
Given the declaration:

double [ , ] values = new double [3, 2]; how would you store 0 in the last
physical location?
a. values = 0;
b. values[6] = 0;
c. values[3,2] = 0;
d. values[2,1] = 0;
e. none of the above
anArray[2, 1] *= 2;
If you declare an array as int [ , ] anArray = new int[5, 3]; you can double the
value stored in anArray[2,1] with the statement:
a. anArray[2,1] = anArray[5,1] * 2;
b. anArray = anArray * 2;
c. anArray[2,1] = anArray[2,1] 2;
d. anArray[2,1] *= 2;
e. none of the above
all have the same type
A two-dimensional array is a list of data items that _____________.
a. all have the same type
b. all have different names
c. all are integers
d. all are originally set to null ('\0')
e. none of the above
values[2, 1] = 0;
Given the declaration:

double [ , ] values = new double [3, 2]; how would you store 0 in the last
physical location?
a. values = 0;
b. values[6] = 0;
c. values[3,2] = 0;
d. values[2,1] = 0;
e. none of the above
anArray[2, 1] *= 2;
If you declare an array as int [ , ] anArray = new int[5, 3]; you can double the
value stored in anArray[2,1] with the statement:
a. anArray[2,1] = anArray[5,1] * 2;
b. anArray = anArray * 2;
c. anArray[2,1] = anArray[2,1] 2;
d. anArray[2,1] *= 2;
e. none of the above
a copy of the value in the element of the ArrayList
When you pass an element from an ArrayList to a method, the method receives:
a. a copy of the ArrayList
b. the address of the ArrayList
c. a copy of the value in the element of the ArrayList
d. the address of the element in the ArrayList
e. none of the above
the address of each of the elements in the ArrayList
When you pass an entire ArrayList to a method, the method receives:
a. a copy of the ArrayList
b. the address of the ArrayList
c. a copy of the first value in the ArrayList
d. the address of each of the elements in the ArrayList
e. none of the above
ToLower( )
To convert all the uppercase letters in a string to their lowercase counterpart,
you can use the ____________ method of the string class.
a. IsLower( )
b. ConvertLower( )
c. Lower( )
d. ToLower( )
e. none of the above
Add( )
Which method in the ArrayList class can be used to place a value onto the end
of the ArrayList?
a. AddLast( )
b. AddLastIndex( )
c. Add( )
d. Insert( )
e. none of the above
Capacity( )
Which method in the ArrayList class can be used to get or set the number of
elements that an ArrayList can contain?
a. Length( )
b. Size( )
c. Dimension( )
d. Rank( )
e. Capacity( )
ArrayList
Which class includes methods to create a dynamic one-dimensional structure?
a. Array
b. string
c. array
d. ArrayList
e. all of the above
result(anArray, 30);
A correct method call to a method that has the following heading would be:

int result(int[ , ] anArray, int num)


a. Console.Write(result(anArray, 3));
b. result(anArray, 30);
c. Console.Write(anArray[ ], 3));
d. result(anArray[ ], 30);
e. none of the above
only be used for read-only access
With two-dimensional arrays a limitation on the foreach statement is that it can:
a. only be used for read-only access
b. only be used with integral type arrays
c. not be used with multidimensional arrays
d. only be used with arrays smaller than 1000 elements
e. not be used with dynamic arrays
none of the above
In order to retrieve a value stored in an object of the Queue class, you would
use which method?
a. Pop( );
b. Push( );
c. Dequeue( );
d. Enqueue( );
e. none of the above
one font size is used with console applications
One of the differences between a console application and a Windows
application is:
a. classes can only be used with console applications
b. one font size is used with console applications
c. variables must be declared with console applications
d. Windows applications require that program statements be placed in a class
e. execution always begins in the Main( ) method for console applications
System.Windows.Forms
Which namespace includes most of the Control classes for developing Windows
applications?
a. System
b. System.Windows.Controls
c. System.Windows.Components.Forms
d. System.Windows.Forms
e. System.Windows.Drawing
a and c
Which of the following inherits members from the Control class?
a. Label
b. Form
c. TextBox
d. a and c
e. all of the above
interface
The ____________ is the front end of a program that represents the
presentation layer or the visual image of the program.
a. interface
b. control
c. Visual Studio
d. IDE
e. framework
event
A(n) _____________ is a notification from the operating system that an action
has occurred, such as the user clicking the mouse or pressing a key.
a. method call
b. statement
c. event
d. GUI
e. handler
Form
Which of the Control objects is viewed as a container that can hold other
objects when you design a Windows application?
a. Control
b. Button
c. Window
d. Frame
e. Form
Text
Which property is used to set the caption for the Windows title bar?
a. Caption
b. Text
c. Title
d. TitleBar
e. WindowTitle
AForm inherits the members of the Form class
The class heading public class AForm : Form indicates that:
a. Form is a derived class of the AForm class
b. AForm is the base class for the Form class
c. the class being defined is identified as Form
d. AForm inherits the members of the Form class
e. none of the above
constructor
If the name of the class is GraphicalForm, the following:

public GraphicalForm( ) is an example of a(n):


a. accessor method
b. property
c. constructor
d. mutator method
e. data member
all of the above
You would use an IDE such as Visual Studio to construct Windows applications
because it has the following capability:
a. drag-and-drop construction
b. IntelliSense features
c. access to the Properties window listing properties and events
d. access to the Toolbox for dropping controls
e. all of the above
event
Click is an example of a(n):
a. event
b. property
c. method
d. control
e. handler
Form Designer
Visual Studio has a number of windows that can be viewed during design. The
window used to hold controls that are dragged and dropped during construction
is called the:
a. Property
b. Code Editor
c. Form Designer
d. Solution Explorer
e. Class View
all of the above
If the System.Windows.Forms namespace is imported, the following statement:

this.textbox1 = new System.Windows.Forms.TextBox( );


can be written as:
a. this.textbox1 = new TextBox( );
b. textbox1 = new TextBox( );
c. textbox1 = new System.Windows.Forms.TextBox( );
d. all of the above
e. none of the above
this.button1 = new System.Windows.Forms.Button;
The statement that actually constructs or instantiates a Button object is:
a. this.button1 = new System.Windows.Forms.Button;
b. private System.Windows.Forms.Button button1;
c. this.Controls.AddRange(this.button1);
d. button1.Name = "A button";
e. button.Click += new System.EventHandler(this.button1_Click);
button1.Click += new System.EventHandler(this.button1_Click);
The statement that registers a Button object click event with the operating
system is:
a. this.button1ClickEvent = new System.Windows.Forms.Button;
b. private System.Windows.Forms.Button button1ClickEvent;
this.Controls.AddRange(this.button1ClickEvent);
d. button1.Click = "Register Me";
e. button1.Click += new System.EventHandler(this.button1_Click);
CharacterCasing
The property of the TextBox control that is used to set all characters to
duppercase as they are typed is:
a. CharacterCasing
b. Text
c. ToUpper
d. UpperCase
e. ConvertToUpper
private void btn1_Click(object sender, System.EventArgs e)
Which of the following might be the heading for an event-handler method?
a. private void btn1_Click(object sender, System.EventArgs e)
b. Application.Run(new TempAgencyForm( ));
c. btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
d. this.btnCalculate = new System.Windows.Forms.Button( );
e. none of the above
all of the above
Which of the following design considerations leads to more user-friendly
presentation layers for GUIs?
a. Avoid clutter
b. Be consistent with font, color, and placement
c. Design for the target audience
d. Use contrast to call attention to something
e. all of the above
collapsible segment of code that must be used for Windows applications
The #region #endregion is an example of a C# ___________.
a. Windows class declaration statement
b. required statement for creating Windows applications
c. reference to a namespace called region
d. preprocessor directive
e. collapsible segment of code that must be used for Windows applications
create separate classes for each
During design, how can you separate the business logic from the presentation
layer?
a. create two forms, one for input and one for output
b. create two objects using an object-oriented approach
c. create at least two methods
d. create separate classes for each
e. all of the above

You might also like