1. (TCO 7) Which of the following statements are true? (Points : 5)
Interfaces contain a list of methods to be implemented later.
Interfaces contain at least one abstract and one implemented method.
Interfaces are instantiated just like regular classes.
An Interface is a very specific type of class implementation.
2. (TCO 7) In an object-oriented program, methods with no implementation might be found in an _____ and/or a(n) ______. (Points : 5)
abstract class; base class
abstract class; interface
interface; base class
None of the above
3. (TCO 7) An object-oriented program may use _____ and _____ to force programmers to adhere to a contract or a specification defined by a framework. (Points : 5)
base classes; abstract methods
abstract classes; interfaces
has-a; is-a relationships
abstract classes; constants
None of the above
4. (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: (Points : 5)
A. Program bugs are isolated to a single class.
B. Programming to an interface makes the code more logical.
Both A and B
None of the above
5. (TCO 8) What are some of the characteristics of “self-documenting” code? (Points : 5)
Detailed comments, addressing all aspects of the code
Deep levels of nesting to ensure all situations are addressed
Straightforward algorithms
All of the above
None of the above
6. (TCO 9) Which of the following allow a programmer to reduce the complexity of an object-oriented program? (Points : 5)
A. create each class in a separate file
B. using namespaces as a container for logically related items
Both A and B
None of the above
7. (TCO 1) Assuming a class definition of a Horse that has a default constructor and constructor that accepts three string arguments, and the appropriate properties defined, how many objects are created in the code below?
static void Main(string[] args)
{
Horse newObject;
Horse newHorseObject = new Horse();
Horse newHorse = new Horse(“Horse”, “Ben”, “Appaloosa”);
newObject = newHorse;
newObject = newHorseObject;
}
(Points : 5)
3
4
2
5
8. (TCO 2) Given a private attribute called weight, which of the following are proper implementations for a getter and a setter? (Points : 5)
void GetWeight(){return weight;}, void SetWeight (int weight){this.weight = weight;}
intGetWeight (){return weight;}, intSetWeight (int weight){return weight;}
intGetWeight (){this.weight = weight;}, void SetWeight (int weight){return weight;}
intGetWeight (){return weight;}, void SetWeight (int weight){this.weight = weight;}
9. (TCO 7) Which of the following declares an abstract method in an abstract class? (Points : 5)
public abstract CalculateTip();
public abstract double CalculateTip();
public double abstract CalculateTip();
public double CalculateTip() {}
1. (TCO 8) Briefly describe best practices as it relates to naming classes.
2. (TCO 2) Does Encapsulation imply Data/Information Hiding in object-oriented programming or vice versa? Are these two terms the same? Please explain. (Points : 18)
3. (TCO 4) What is inheritance and what are the major benefits of using inheritance? What programming technique shall you follow when the base class methods are not appropriate for the derived class object?
4. (TCO 6) What is static binding? What is dynamic binding? How do you distinguish between static binding and dynamic binding?
5. . (TCO 2) Given the following list of classes, attributes and methods,
– identify which items are classes, which items are attributes and which items are methods;
– identify which class each attribute and method belongs to; and
– suggest a class hierarchy given your list of classes.
*Note – no particular capitalization scheme is used in the list below to differentiate between classes, methods and attributes.
LandOnStatue, NumberOfLegs, Height, ShoeSize, Eat, Animal, Speak, WingSpan, Age, Peck, Sleep, Horse, LengthOfMane, Move, BeakLength, LengthOfTail, Bird, SaddleUp
6. (TCO 2) Briefly describe what an Interface is and how it can be used in an object-oriented program. Provide example pseudocode showing how an IAnimal Interface might be constructed. (Points : 18)
7. (TCO 2) Keeping in mind all object-oriented programming best practices, create a class for a Cabinet, with the following specifications:
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.