Question 1. 1. (TCO 2) Only those class members that are part of the implementat
ID: 3557315 • Letter: Q
Question
Question 1.1. (TCO 2) Only those class members that are part of the implementation of the class should be declared as ______. (Points : 2) publicbanned
private
available Question 2.2. (TCO 2) _____ and _____ are other terms for getters and setters. (Points : 2) Constructors; destructors
Public; private
Retrievals; putters
None of the above Question 3.3. (TCO 2) Which of the following statements is/are false? (Points : 2) If a method is public, it is considered part of the class interface.
One goal regarding the implementation of a class should be kept in mind: a change to the implementation should not require a change to the users code.
If you declare an attribute as public, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging.
All of the above
None of the above Question 4.4. (TCO 2) A Waiter is responsible for taking the order from the Customer based on the menu, 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 Waiter object, which of the following would you consider as (an) appropriate message(s) the Waiter should respond to? (Points : 2) The spaghetti and meatballs dish is ready!
The hamburger dish is ready. Handle the plate carefully and take it to table 9, along with some ketchup and mustard. Ask if the customer would like some mayonnaise as well.
What would you like to eat?
All of the above
Only A and B Question 5.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 Question 6.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 Question 7.7. (TCO 5) Consider the following class definition and the object instantiation.
class House
{
private:
int age;
double salesPrice;
public:
House()
{
age = 1;
salesPrice = 2.0;
}
House(int a, double sp)
{
age = a;
salesPrice = sp;
}
int getAge()
{
return age;
}
double getSalesPrice()
{
return salesPrice;
}
~House() { }
} ;
int main()
{
int tempAge=0;
int tempPrice=0;
House ranch();
return 0;
}
Using the main() method to access the members of the object, which of the following statement is correct?
(Points : 2) tempPrice = House.SalesPrice();
ranch.salePrice = 250000.0;
ranch.age = 3;
cout<<The house price is: << ranch.SalesPrice(); Question 8.8. (TCO 2) Assume a class has a data member called color. Can another class have a data member called color? (Points : 2) Yes, as long as the data member is used in the same way.
No, this is not possible because the compiler would not know which data member to use.
No, this is a syntax error.
None of the above Question 9.9. (TCO 5) Which error handling technique is the least appropriate when developing an application?
(Points : 2) Check for potential problems and abort the application when a problem is encountered.
Check for potential problems and throw an exception.
Check for potential problems, catch the mistake, and try to fix it.
Ignore the problem; all applications crash at some point. Question 10.10. (TCO 2) Which is an appropriate choice for a static attribute in a Building class?
(Points : 2) numberOfBuildings
numberOfApartments
numberOfFloors
None of the above Question 1.1. (TCO 2) Only those class members that are part of the implementation of the class should be declared as ______. (Points : 2) public
banned
private
available
Explanation / Answer
1. private
2.None of the above correct amswer is accessors and mutators
3.If you declare an attribute as public, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging.
4.Only A and B
5. destructor
6. All of the above
7. tempPrice = House.SalesPrice();
8.Yes, as long as the data member is used in the same way.
9. Check for potential problems, catch the mistake, and try to fix it.
10. numberOfFloors
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.