Docsity

Object Oriented Programming NBCC Quiz 3 & 4 rated A., Exams of C programming

Toggle sidebar
bg1
Object Oriented Programming NBCC
Quiz 3 & 4 rated A
In a three-layer application, the three layers are - correct answer
✅the presentation layer, the middle layer, and the database layer
When you design and develop business classes for an application,
your goal is to - correct answer ✅allow development to be spread
among members of a development team
separate the business rules from the presentation and database
logic
make the application easier to develop and maintain
(all of the above)
A class defines the properties and methods of - correct answer
✅an object
The process of creating an object from a class is known as -
correct answer ✅instantiation
What feature are you taking advantage of when you call the
ToDecimal method of the Convert class without knowing how it's
coded? - correct answer ✅encapsulation
The fields of a class - correct answer ✅are the variables that are
defined at the class level
pf3
pf4
pf5

Partial preview of the text

Download Object Oriented Programming NBCC Quiz 3 & 4 rated A. and more Exams C programming in PDF only on Docsity!

Quiz 3 & 4 rated A

In a three-layer application, the three layers are - correct answer ✅the presentation layer, the middle layer, and the database layer When you design and develop business classes for an application, your goal is to - correct answer ✅allow development to be spread among members of a development team separate the business rules from the presentation and database logic make the application easier to develop and maintain (all of the above) A class defines the properties and methods of - correct answer ✅an object The process of creating an object from a class is known as - correct answer ✅instantiation What feature are you taking advantage of when you call the ToDecimal method of the Convert class without knowing how it's coded? - correct answer ✅encapsulation The fields of a class - correct answer ✅are the variables that are defined at the class level

Quiz 3 & 4 rated A

Two objects created from the same class can have different - correct answer ✅data A class file that you add to a project has the extension - correct answer ✅cs To return the value of an instance variable named v from a get accessor, you code - correct answer ✅return v; 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; } } - correct answer ✅firstName A read-only property consists of just - correct answer ✅a get accessor

Quiz 3 & 4 rated A

When can you not code a method using an expression body? - correct answer ✅When the method executes a block of statements The live code analysis feature lets you generate a code stub for a class or member from - correct answer ✅the Quick Actions menu To review the members of two or more classes at the same time, you can use - correct answer ✅a class diagram To generate the starting code for a new member of a class, you can use - correct answer ✅the Class Details window To browse the classes in a solution, you can use - correct answer ✅The Solution Explorer You can use the Peek Definition window to - correct answer ✅display the definition of a class member from within a class that refers to it To display the location of each reference to a class or member when it's displayed in the Code Editor, you can use - correct answer ✅The CodeLens Feature Which of the following is not true about a structure? - correct answer ✅A structure lets you instantiate a reference type just like a class.

Quiz 3 & 4 rated A

An indexer - correct answer ✅is a special type of property uses the this keyword in its declaration lets the user of a class access an item by using an index (all of the above) When coding a business class, why would you want to throw an argument exception from a property or method? - correct answer ✅So the business class is completely self-contained and doesn't depend on classes that may be coded by other programmers to validate data The declaration for an event specifies - correct answer ✅a delegate that will handle the event and the event's name To raise an event, you code - correct answer ✅the name of the event along with its arguments Operator overloading is typically used to - correct answer ✅define or redefine the function of an existing operator for a user-defined data type To overload the == operator, you must override

Quiz 3 & 4 rated A

(Refer to code example 13-2.) What is the name of the method that handles the event? - correct answer ✅Customer_NameChanged When you code a statement in a form class that uses a property that throws an argument exception if the argument that's passed to it is invalid, you should - correct answer ✅validate the argument before it is passed to the property so the exception is never thrown Which of the following can you not wire to an event? - correct answer ✅a delegate