There Is No Limit
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 ______________.
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
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
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
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;
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?
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?
a. 18
b. 32
c. 28
d. 30
e. none of the above
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?
a. answer = Floor(87.2);
b. answer = Math.Floor(87.2);
c. Floor(87.2);
d. Math.Floor(double);
e. Math.Floor(87.2);
DetermineHighestScore(val1, val2);
Which of the following is a valid method call for DetermineHighestScore?
public SetNoOfSquareYards(double)
What is the signature of the following method?
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
someValue = ComputeCost(27.3);
DisplayInstructions( );
InitializeValues( );
Which of the following would be a valid call to a method defined as shown
below?
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
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
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?
accessor
The following is probably an example of a(n) ____________.
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:
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
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?
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
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
b
Using the following declaration:
x[4] += 42;
Which of the following adds 42 to the element at the fifth physical spot?
3
How many components are allocated by the following statement?
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
display 600
With the following declaration:
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:
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: