View the step-by-step solution to:

Page 1 1. (TCO 2) Only those class members which are hidden from users of the class are part of the _____ of the class. (Points :

This question was answered on Jan 19, 2013. View the Answer
Page 1







1. (TCO 2) Only those class members which are hidden from users of the class are part of the _____ of the class. (Points : 2)
interface
implementation
constructors
GUI (graphical user interface)





2. (TCO 2) A public accessor can be paired with a public _____ to allow an outside class to set and retrieve the value of an object’s attribute. (Points : 2)
constructor
mutator
getter
None of the above





3. (TCO 2) Which of the following statements is/are false? (Points : 2)
A change to the implementation should not require a change to the user’s code.
If you declare an attribute as private, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging.
When interacting with the interface of an object, you need to know what the code looks like inside the methods, which comprise the interface.
All of the above
None of the above





4. (TCO 2) A Waiter is responsible for taking the order from the Customer, informing the Chef of the order, and delivering the requested food back to the Customer. A Chef is responsible for preparing the food and notifying the Waiter when the food is ready. The Customer is responsible for placing an order from the menu. In identifying the interface of the Chef object, which of the following would you consider as (an) appropriate message(s) the Chef should respond to? (Points : 2)
“Take a pound of ground meat, add a chopped onion, salt, pepper, parsley and broil for 15 minutes until the burger becomes golden brown.”
“What do you do after work?”
“Prepare a steak, medium-rare.”
All of the above
Only A and C





5. (TCO 5) One of the purposes of a(n) _____ is to release resources back to the system when the object is not used anymore. (Points : 2)
class
constructor
destructor
instance variable





6. (TCO 5) Which of the following method pairs depict method overloading? (Points : 2)
public void Roll() ; public int Roll(int x)
public int Reverse(int x, int y) ; public int Reverse(int y, int x)
public int Subtract(int x, int y) ; public int Subtract(int x, int y, int z)
All of the above
Only A and C





7. (TCO 5) Consider the following class definition.

public class Flower
{
private string color;
private double cost;

public Flower()
{
color = “red”;
cost = 0.0;
}
public Flower(string c)
{
color = c;
cost = 0.0;
}

public void Color(string c)
{
color = c;
}
public void Cost(int amount)
{
cost = amount;
}
}

Which of the following is/are true:

(i) The attribute cost can be set to a new value, by a user of this class.
(ii) You can write Console.WriteLine(“The flower is: “ + Flower.Color());
(iii) A default constructor is provided.
(Points : 2)
i.
ii
Only i and iii
None are true
All are true





8. (TCO 2) Assume a class has a method called ‘ComputeAverage()’. Can another class have a method called ‘ComputeAverage()’? (Points : 2)
Yes, as long as the method performs the same or similar task.
Yes, this is possible.
No, because the compiler cannot distinguish the appropriate method to call.
None of the above





9. (TCO 5) Which of the following statements is/are true?
(Points : 2)
Most object-oriented languages provide a feature called exceptions.
One error handling strategy is to check for problems and attempt to recover.
In a try/catch block, if an exception is thrown within the try block, the catch block will handle it.
All of the above





10. (TCO 2) Assume a class contains two non-static data members and one static data member. If two objects have been instantiated from the class, how many copies of the static data member exist?
(Points : 2)
3
6
2
1






Time Remaining:
Sign up to view the entire interaction

Top Answer

The way to approach this... View the full answer

OOPs - Solution.docx

Ans 1 implementation 2 constructor 3 All 4 - Only A and C 5 destructor 6 -Only A and C 7i 8 - Yes, this is possible. 9 - All of the above 10 - 1

This question was asked on Jan 19, 2013 and answered on Jan 19, 2013.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors and customizable flashcards—available anywhere, anytime.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access or to earn money with our Marketplace.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
  • -

    Flashcards

    Browse existing sets or create your own using our digital flashcard system. A simple yet effective studying tool to help you earn the grade that you want!

    Browse Flashcards