• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/78

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

78 Cards in this Set

  • Front
  • Back

To browse the classes in a solution, you can use

b. The Solution Explorer

A class file that you add to a project has the extension

d. cs

Which of the following method declarations overrides the method that follows?


protected virtual double CalculateMilesPerGallon(double speed){...}

d. public override double CalculateMilesPerGallon(double s){...}

The result set retrieved by the following Select statement contains records that have


Select Balance, Number


From Accounts


Where Balance < 0

b. two of the columns from the Accounts table where Balance is less than 0

Which of the following can a Select statement not do?

d. Modify selected data

By default, the Data Source Configuration Wizard generates Update and Delete statements that use Answer clauses to implement optimistic concurrency.

The correct answer is: Where

In general, there are two categories of data errors that occur when you use a data source: data provider errors and Answer errors.

The correct answer is: ADO.NET

What type of file is opened in the window below?




b. a binary file

To read data from a binary file, you need to use a FileStream object and a

c. BinaryReader object

A property that's coded without get and set accessors is called a/an Answer property.

The correct answer is: auto-implemented

The Generate From Usage feature lets you generate a code stub for a class or member from

b. the smart tag menu

Code example 14-1


public class SavingsAccount : Account


{


public SavingsAccount() : base()


{


base.Type = "Savings";


}



public SavingsAccount(int number) : base(number)


{


base.Type = "Savings";


}



public SavingsAccount(int number, decimal balance) :


base(number, "Savings", balance)


{


}


}




(Refer to code example 14-1.) Which of the following statements creates an object of the Account class?

b. Account account = new Account(111, "Checking", 0.0m);

A class that can't be inherited by another class is called a/an Answer class.

The correct answer is: sealed

Which of the following statements is not true? An ADO.NET dataset object

d. can store command objects

Each record in a relational database is called a Answer.

The correct answer is: row

When you use a data source with individual controls instead of a DataGridView control, you can do all but one of the following. Which one is it?

b. code exception handlers for DataError events

When you use a data source to get data from a database, you can

a. select one or more tables with just the columns that you want from each table

When you use a data source, the SQL statements that are used to retrieve and update rows can be found in the SelectCommand and UpdateCommand properties of the

d. table adapter

Assume that you have a valid StreamWriter object named textOut. What does the following code do?


textOut.Write("Wizard of Oz");


textOut.Write("\t");


textOut.WriteLine("1939");

a. Writes a record that consists of two tab-delimited fields to a text file

If the path variable contains a string that refers to an existing file, what does the following code do?


FileStream fs = new FileStream(path, FileMode.OpenOrCreate);

c. Opens the file

Two objects created from the same class can have different

c. data

If you code a get accessor for a property but you don't code a set accessor, the property will be a Answer property.

The correct answer is: read-only

Which of the following can you not code in a subclass?

a. A call to a private method of the base class

The GetType method of an object returns

a. a Type object that contains information about the object's type

The data that's retrieved by a Select statement is called a

c. result set

Which of the variables declared in the following class is an instance variable?


public class Customer


{


public string firstName;


private static int count;


public string GetDisplayText()


{


string displayText = firstName + count;


return displayText;


}


}

b. firstName

To begin the declaration for a property, you code the public keyword followed by

b. the data type and the name of the property

A class can

a. be both a base class and a derived class

To communicate with a DBMS, the application software sends

d. SQL queries

To modify a SQL query using a graphical interface, you can use the Answer.

The correct answer is: Query Builder

The primary difference between a text file and a binary file is that a binary file

d. stores data with different data types //

When you call the Write method of a binary output stream, you must specify

c. the data to be written

To make a method in a class available to other classes, you begin the method declaration with

d. the public keyword



(Refer to diagram 14-1.) If the constructor that follows is called, what other constructor is also called?


public Sailboat(string id, decimal length, int sails) : base(id, "sailboat", length)


{


this.sails = sails;


}


b. public WaterCraft(string id, string type, decimal length){…}

The hardware components of a typical multi-user system are

a. the clients, the server, and the network

In the statement that follows, the UpdateAll method


this.tableAdapterManager.UpdateAll(this.mMABooksDataSet);

d. updates the database with data from all the tables in the dataset

The Fill method of a table adapter object that's working with a SQL Server database will throw errors of the

b. SqlException class

The Answer class is the base class for exceptions that are thrown during the processing of a stream, file, or directory.

The correct answer is: IOException

When you're entering the C# code for a form and want to refer to a static method in another class, you start with

a. the name of the class that contains it

You can use an auto-implemented property when

b. you want the get and set accessors to simply return and set the value of an instance variable

In the statement that follows, the Fill method


this.productsTableAdapter.Fill(this.mMABooksDataSet.Products);

a. loads the Products table in the dataset with data from the database

If the path variable contains a string that refers to an existing file, what does the following code do?


FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Write);

c. Opens the file so data can be written to it, but not read from it

What feature are you taking advantage of when you call the ToDecimal method of the Convert class without knowing how it's coded?

d. encapsulation

Code example 14-1


public class SavingsAccount : Account


{


public SavingsAccount() : base()


{


base.Type = "Savings";


}



public SavingsAccount(int number) : base(number)


{


base.Type = "Savings";


}



public SavingsAccount(int number, decimal balance) :


base(number, "Savings", balance)


{


}


}




(Refer to code example 14-1.) If the statement that follows is executed, which of the following constructors will be called?


SavingsAccount account = new SavingsAccount(111);

a. public Account(int number){...}

A class that can be inherited by another class but can't be instantiated is called a/an Answer class.

The correct answer is: abstract

What is the primary function of a data adapter?

d. To manage the flow of data between a client program and a database

To store the databases of a client/server system, the server requires

b. a database management system

Assume that you have a valid StreamReader object named textIn. What does the following code do?


while (textIn.Peek() != -1)


{


string row = textIn.ReadLine();


MessageBox.Show(row);


}

b. Displays each line of a text file in successive message boxes

What type of exception can be prevented by using the Peek method?

d. EndOfStreamException

A structure is similar to a class but it defines a Answer type.

The correct answer is: value

Assume that the Vehicle class contains a virtual method named CalculateMaxSpeed. Assume that both the MotorVehicle and Automobile classes override this method. Which class defines the method that is called when the second statement in the code that follows is executed?



MotorVehicle car = new Automobile();


car.CalculateMaxSpeed();

c. Automobile

Diagram 14-1






(Refer to diagram 14-1.) If the MotorVehicle class contains a protected method named GetEngineType, what other class or classes can access this method?

c. Automobile and Motorcycle

Code example 17-1


Select VendorName, InvoiceNumber, InvoiceDate, InvoiceTotal


From Vendors Inner Join Invoices


On Vendors.VendorID = Invoices.VendorID


Where InvoiceTotal >= 500


Order By VendorName Desc




(Refer to code example 17-1.) If VendorName contains string data and InvoiceTotal contains decimal values, how will the result set be ordered?

d. alphabetically starting with Z

After you create a data source, the Data Sources window shows all of the tables and columns in the related Answer.

The correct answer is: dataset

When you use a method to read data from a text file, you normally read

b. one line

The data of a class is stored in the class's Answer.

The correct answer is: fields

The constructor of a derived class automatically calls the default Answer of the base class before the constructor for the derived class is executed.

The correct answer is: constructor

Code example 17-1


Select VendorName, InvoiceNumber, InvoiceDate, InvoiceTotal


From Vendors Inner Join Invoices


On Vendors.VendorID = Invoices.VendorID


Where InvoiceTotal >= 500


Order By VendorName Desc



(Refer to code example 17-1.) What table(s) does the data in the result set come from?

c. Vendors and Invoices

What namespace does the .NET Framework use to store classes that work with input and output operations?

c. System.IO

What type of exception can be prevented by using the Exists method of the File class?

d. FileNotFoundExeption

If you are designing the classes for an application and you realize that two classes share some common elements, you can define those elements in a Answer class.

The correct answer is: base

When you use the .NET data provider objects to retrieve data from a database, you can store the data in an object called a

c. dataset

A file that is read by a program is known as an Answer file.

The correct answer is: input

When used correctly, inheritance can

b. simplify the overall design of an application

A read-only property consists of just

b. a get accessor

When you develop an application using a three-layer architecture, the layer that provides the user interface is called the Answer layer.

The correct answer is: presentation

To declare a method or property that can be overridden by a subclass, you use the Answer keyword as the access modifier for the method or property.

The correct answer is: virtual

All objects have access to the methods of the Answer class.

The correct answer is: Object

If you execute a Select statement directly instead of using a data adapter, what object do you use to read the data that's returned?

b. data reader

A class defines the properties and methods of

a. an object


If the Student class inherits the Person class and overrides a virtual method named GetBirthday, which method does the third statement in the following code example call?


Student s = new Student("Albert Einstein");


Person p = s;


p.GetBirthday();

b. the GetBirthday method defined in the Student class

The BindingNavigator control (toolbar) that's added to a form along with a DataGridView control can be used to do all but one of the following. Which one is it?

a. undo an update

If you save the connection string for a data source in the configuration file for the application,

a. you can change the string in just the configuration file if the connection changes

The ToString, Equals, and GetHashCode methods are available to all objects because

b. they are members of the System.Object class, which all objects inherit

If a method accepts an Object type, what types of objects can it accept?

d. All objects

If you access a virtual method of a base class object and that method is overridden in the subclasses, the method that is called depends upon the Answer of the object

The correct answer is: type

Which of the following is not true about a structure?

c. A structure lets you instantiate a reference type just like a class.

When you design and develop business classes for an application, your goal is to

b. all of the above