0% found this document useful (0 votes)
12 views14 pages

The Read Method

The document contains a series of questions and answers related to various programming concepts across multiple chapters. Topics include methods, databases, data types, object-oriented programming, collections, arrays, event programming, debugging, file handling, decision making, class creation, looping, and web-based applications. Each chapter presents multiple-choice questions designed to test knowledge on specific programming principles and practices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views14 pages

The Read Method

The document contains a series of questions and answers related to various programming concepts across multiple chapters. Topics include methods, databases, data types, object-oriented programming, collections, arrays, event programming, debugging, file handling, decision making, class creation, looping, and web-based applications. Each chapter presents multiple-choice questions designed to test knowledge on specific programming principles and practices.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 3: Methods and Behaviors

Q1) The Read( )method ____.


A) is a nonvalue-returning method
B) returns a string
C) returns a single char
D) returns an int

See Q1 Verified Answer

Q2) The Read( )method ____.


A) is a nonvalue-returning method
B) returns a string
C) returns a single char
D) returns an int

See Q2 Verified Answer

Q3) The definition of the method includes the entry inside the curly braces,which is
sometimes called the body of the method.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter
Chapter 14: Working with Databases

Q1) When you select the TableAdapter object (from the component tray)and view its
properties,you will not see the SelectCommand,InsertCommand,UpdateCommand,and
DeleteCommand [Link] order to change the SQL statements associated with
those properties,you need to use the DataSet Designer and modify the ____________
for these properties.

See Q1 Verified Answer

Q2) Data is stored in tabular format for a relational [Link] row in the table
represents a(n)____.
A) table
B) field
C) key
D) record

See Q2 Verified Answer

Q3) The ____________ class can be used to generate SQL statements automatically
so that you do not have to do additional SQL programming beyond the initial SELECT
statement used to retrieve the records.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 2
Chapter 2: Data Types and Expressions

Q1) The @ symbol in the following string,@ "C :\MyProjects",is called


a(n)____________ character.

See Q1 Verified Answer

Q2) Which of the following is a valid compile-time initialization for amountDue,a variable
of the decimal type,that will initially be set to zero?
A) amountDue = 0;
B) amountDue = '0';
C) amountDue = 0m;
D) amountDue = 0d;

See Q2 Verified Answer

Q3) ____________ is the universal character-encoding schema that provides a


unique number for every character in many different languages.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 3
Chapter 11: Advanced Object-Oriented Programming

Features

Q1) Multiple inheritance is not possible in C#;____ provides the closest work around to
this because a class can implement multiple ____.
A) interfaces
B) abstract classes
C) virtual classes
D) components

See Q1 Verified Answer

Q2) Class library components should be compiled using a Build option instead of
Running the application.

See Q2 Verified Answer

Q3) Polymorphic programming is associated with the ____________.You do not have


to know how the method goes about doing its [Link] you have to know is what
arguments to send,if any,and what you expect to be accomplished when the object
finishes its work.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 4
Chapter 8: Advanced Collections

Q1) [Link]("anExample".IndexOf("a"));returns ____.


A) null
B) 4
C) 04
D) 0

See Q1 Verified Answer

Q2) C# uses a row major format for accessing arrays,which means that the elements
are printed in [Link] entry in the first column is printed before moving to the second
column.

See Q2 Verified Answer

Q3) double [ , ] price = new double [2 , 5] {{1.1, 1.2, 1.3, 1.5, 1.4}{2.1, 2.2, 2.3, 2.5, 2.4}};
With the declaration above,price[0,2] refers to 2.2.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 5
Chapter 7: Arrays

Q1) Arrays are ____________ [Link] array identifier memory location does not
actually contain the values,but instead stores an address indicating the location of the
first element in the array.

See Q1 Verified Answer

Q2) Elements in an array are sometimes referred to as ____________ variables.

See Q2 Verified Answer

Q3) What happens when you assign one array to another using the assignment
operator?
A) An error message is generated.
B) Elements are copied to new memory locations.
C) Both arrays become value type data elements.
D) Both arrays reference the same memory locations.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 6
Chapter 10: Programming Based on Events

Q1) The this keyword is used to indicate the current instance of the delegate.

See Q1 Verified Answer

Q2) One of the advantages of a ListBox object over other types of objects used for input
is ____.
A) it can be used for both input and output
B) it can be used for both console and Windows applications
C) an event handler method can be registered
D) multiple selections can be made

See Q2 Verified Answer

Q3) Delegate declarations resembles ____ declarations.


A) method
B) variable
C) object
D) data

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 7
Chapter 12: Debugging and Handling Exceptions

Q1) A stack trace is a listing of all the methods that are in the execution chain when the
exception is thrown.

See Q1 Verified Answer

Q2) An error such as attempting to divide by zero during runtime will always throw an
exception.

See Q2 Verified Answer

Q3) All exception classes inherit from the ____ class.


A) SystemException
B) Exception
C) ApplicationException
D) BaseExcecption

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 8
Chapter 1: Introduction to Computing and Programming

Q1) As far as the compiler is concerned,you could actually type the entire program
without touching the Enter key.

See Q1 Verified Answer

Q2) A(n)______________ is a user-supplied or user-created name.

See Q2 Verified Answer

Q3) Programmers commonly verify that their design is correct by doing


a(n)_____________.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 9
Chapter 13: Working with Files

Q1) The GetAttributes( )method of the File class returns a FileAttribute,like Archive,when it
invoked.

See Q1 Verified Answer

Q2) StreamWriter outputFile = new StreamWriter("someOutputFileName");


StreamReader inputFile = new StreamReader("someInputFileName");
If an invalid path is included with the constructor for a StreamWriter object,____.
A) an InValidPathException is thrown
B) a System exception occurs
C) an IOException exception is thrown
D) the program terminates

See Q2 Verified Answer

Q3) StreamWriter outputFile = new StreamWriter("someOutputFileName");


StreamReader inputFile = new StreamReader("someInputFileName");
If you browse using Windows Explorer or Computer,the physical file that already exists
before the two statements from above are executed is ____.
A) outputFile
B) inputFile
C) someOutputFile
D) someInputFile

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 10
Chapter 5: Making Decisions

Q1) if (amount > 1000)


result = 1;
else
if (amount > 500)
result = 2;
else
if (amount > 100)
result = 3;
else
result = 4;
What is stored in result when amount is equal to 12000?
A) 1
B) 2
C) 3
D) 4

See Q1 Verified Answer

Q2) ____ perform differently based on their operands.


A) Overloaded operators
B) Conditional expressions
C) Boolean operators
D) Relational operators

See Q2 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 11
Chapter 4: Creating Your Own Classes

Q1) If berber is an object,the statement [Link](berber);automatically invokes the


____________ method.

See Q1 Verified Answer

Q2) Instance methods manipulate data by ____.


A) directly accessing private data members.
B) passing information as arguments through parameters.
C) using constructors and accessors.
D) sending visible data in the Main( ) method.

See Q2 Verified Answer

Q3) Constructors should be defined with a ____ access modifier.


A) public
B) private
C) protected
D) static

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 12
Chapter 6: Repeating Instructions

Q1) int loopVariable = 0;


do
{
[Link]("Count = {0:}", ++loopVariable);
}while (loopVariable < 5);
What will be printed during the first iteration through the loop?
A) 0
B) 1
C) 10
D) none of the above

See Q1 Verified Answer

Q2) In C# curly braces must be added to surround all loop bodies.

See Q2 Verified Answer

Q3) If a numeric variable is being changed by a consistent amount with each iteration
through the loop,the while statement is the best choice of loop constructs.

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 13
Chapter 15: Web-Based Applications

Q1) With Windows and console-based applications,execution begins with the first
statement in the Main( )[Link] a Web application,execution begins with the first
statement in the ____.
A) Main( ) method.
B) Page_Load( ) method
C) constructor method
D) InitializeComponent( ) method

See Q1 Verified Answer

Q2) The Calendar control has a number of properties including the ____________
property that is used to pick the month,day,and year for display.

See Q2 Verified Answer

Q3) What is the name of the CSS file that you should find in the Solution Explorer window?
A) [Link]
B) [Link]
C) [Link]
D) [Link]

See Q3 Verified Answer

Click here! To get all questions and flashcards with answers for this chapter

Page 14

You might also like