Programming Final

Ace your homework & exams now with Quizwiz!

accessors

"Getters" are referred to as ____.

child class

A ________ is a synonym for a derived class.

subclass

A ___________ is a synonym for a derived class.

entity

A class is normally associated with a(n) ____, which often describes a person, place, or thing and is normally a noun.

true

A class named River will have a constructor named River.

derived class

A class that inherited from a base class is a _________.

base class

A class that is used as a basis for inheritance is called a(n):

true

A collection is any data structure, like an array or a List, that holds objects of the same type.

false

A constructor is used to instantiate a class from an object.

true

A derived class is one that has inherited from a base class.

false

A sealed class can be extended, meaning you can create a derived class from it.

false

A standard convention used by C# programmers is to use camel case style for properties.

true

A standard naming convention in C# for properties is to use the same name as the instance variable or field, except begin the identifier using an uppercase character (Pascal case).

false

A superclass is a derived class, while a subclass is a base class.

protected

A(n) ________ data field or method can be used within its own class or in any classes extended from that class, but it cannot be used by "outside" classes.

public

Accessors, mutators, and other instance methods are normally defined with what type of access modifier?

true

An object is an instance of a class.

class

C# is an object-oriented language. All the code for an application must be placed in a(n) ____.

4

Constructors ____. 1) can be overloaded. 2) do not have to be written. 3)do not return a value. 4)all of the above.

true

Constructors are methods.

public

Constructors should be defined with a ____ access modifier.

true

If a try block is used to handle exceptions, you must also specify a catch clause.

bin/debug

If you do not specify the full path for the file name, Visual Studio uses the ____________ subdirectory of the current project.

true

If you use Visual Studio and include a reference to the System.IO namespace, IntelliSense provides helpful information while you are developing your file application.

override

In C#, you can use either new or ______ when defining a derived class member that has the same name as a base class member.

use override in heading

In order to provide a new definition for the ToString( ) method, ____.

false

Mutators are special types of methods used to create objects.

false

No exception is thrown if you attempt to close or open a file that does not exist.

private

Normally fields, or data members, are defined to have ____ access.

true

Since the data members of the class are defined as private, their public property counterpart must be used to assign new values to the data members.

string

StreamReader inFile = new StreamReader("name.txt"); while ((inValue = inFile.ReadLine()) != null) Using the above segment of code, inValue would be defined as what type of data?

Reads every line from an input file.

StreamReader inFile = new StreamReader("name.txt"); while ((inValue = inFile.ReadLine()) != null) What does the above statement do?

output file

StreamWriter outputFile = new StreamWriter("someOutputFileName"); StreamReader inputFile = new StreamReader("someInputFileName"); The identifier that can be referenced in a WriteLine( ) method with the declaration above is ____.

false

The StreamReader class is most often used to retrieve single characters, one character at a time, from a file.

false

The StreamReader class is used to create text files.

flush

The StreamWriter method(s) that clears all buffers for the current writer and causes any buffered data to be written to the underlying stream is ____.

object class

The ToString( ) method is automatically invoked when an object reference is made in the ____.

StreamWriter

The ____ class has implementations for Write( ) and WriteLine( ) methods similar to the Console class methods.

message

The ____ property associated with the Exception object returns a string describing the exception.

system.io

The abstract classes of StreamReader and StreamWriter are defined for dealing with files in the ____ namespace.

true

The constructor for the StreamWriter can include additional arguments indicating whether the file should be appended to or overwritten if it already exists.

true

The default constructor normally has an empty body.

base

The keyword _______ always refers to the superclass of the class in which you use it.

true

The keyword base always refer to the superclass of the class in which you use it.

true

The keyword new is used as an operator to call constructor methods.

true

The keyword override is used in method headers when you create a derived class that inherits an abstract method from a parent class.

true

Three of the contextual keywords associated with properties are get, set, and value.

write more than one constructor

To add full functionality to your classes, ____.

set

To define a property to change a data member of a class include a ____ clause.

true

To invoke File's Copy( ) method to make a copy of "source.txt", naming the new file "target.txt", you would write: File.Copy("source.txt", "target.txt"); because Copy is a static member of the File class.

objects

To program an object-oriented solution, begin by determining what ____ are needed in the solution.

"is a"

When presented with two classes that have a parent-child relationship, you can tell which class is the base class and which is the derived class by using the two classes in a sentence with the phrase ________.

true

When you close a file, no arguments are sent to the method; however, the Close( ) method must be called with a file object such as reader.Close( ).

true

When you define a class and determine what data members it should have, you are declaring instance variables or fields that will represent the state of an object.

true

When you define a property, you can define the get without the set, but you must define a get.

true

When you define methods of a class, you are defining its behaviors, in terms of what kinds of things it can do.

4

When you define the class, you describe its ____ in terms of data and its behaviors, or methods, in terms of what kinds of things it can do. 1) attributes 2) fields 3) characteristics 4) all of the above

verbatim string

When you place an @ in front of a string, the string becomes a(n) ____.

Writeline

Which method, used with the StreamWriter class, can be invoked to write characters to the stream, followed by a line terminator?

false

With Visual Studio when you create a file (or attempt to access one), if a path is not specified with the filename, the Apps\Debug sub-directory of the current project is used.

true

With the object-oriented approach, objects send messages to other objects and receive messages from objects.

true

You can use the Split method to create an array of values from a single line of text, as long as there is a delimiter, such as a tab, a comma, and a vertical bar (|).

accessors

____ are special methods used to read the current state or value of an object member's data.

4

plush.PricePerSqYard = 40.99; If proper naming conventions were used in the above statement, which of the following statements is true? 1) PricePerSqYard is a property 2) plush is an object 3) 40.99 is a numeric literal 4) all of the above


Related study sets

General Pathology Questions (Part 4/4)

View Set

Series 79 Unit 7 - Registration Process

View Set

vocabulary workshop level d units 1-5

View Set

Managing people and work Exam 2 (Chen)

View Set

Chapter 4: International Financial Reporting Standards Part I

View Set

Xcell Testing Solutions (Life & Health) Final 150 Question Practice Exam

View Set

CANADIAN IMMIGRATION & REFUGEE LAW - CHAPTER 1

View Set