Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1 5 pts (TCO 1) Which of the following would be a more appropriate choi

ID: 2246651 • Letter: Q

Question

Question 1
5 pts
(TCO 1) Which of the following would be a more appropriate choice for a method in a Fork class?

Color()

Bend()

Eat()

Material()


Question 2
5 pts
(TCO 1) Object-oriented programming generally does NOT focus on _____.

A. separating the interface from the implementation.

B. client side access to implementation details.

C. information hiding.

D. ease of program modifiability.

All of the above

None of the above

Only A, C, and D



Question 3
5 pts
(TCO 2) Which of the following components of a class definition do not have a return type?

Public member methods

Accessor/mutator methods

Constructors

Private member methods

None of the above



Question 4
5 pts
(TCO 2) Which of the following statements is/are true?

A. A private (helper) method can only be used inside the class. It cannot be called through an object of the class.

B. The programmer can control the scope of a data member of a class using access specifiers.

C. The state of an object must be hidden and therefore protected by unauthorized use.

All of the above

Only A and C


Question 5
5 pts
(TCO 5) Which of the following method pairs are examples of method overloading?

public void Bake() ; public int Bake(int x)

public int Mix(int x, int y, int z) ; public int Mix(int y, int x, int z)

public int Shake(int x, int y) ; public int Shake(int x, int y, int z)

All of the above

Only A and C



Question 6
5 pts
(TCO 1) Which of the following statements is/are false?

Member methods are the means by which you implement the behavior of a class.

By using the keyword class in your program, memory is allocated for the object being defined.

Objects are created during program execution and eventually destroyed.

None of the above



Question 7
5 pts
(TCO 2) You need to design an Automobile class. How can you utilize the concept of encapsulation to design this class?

Subdivide the two most general attributes of any Automobile, make and model, into more specific attributes.

Create a Make class and a Model class and integrate them into Automobile using composition.

Include both general attributes such as make and model with generic behaviors such as consumeFuel and moveForward into one entity.

Find a Transportation class and inherit everything you need from it

All of the above



Question 8
5 pts
(TCO 2) You need to utilize an Item class in your own object-oriented class using composition. Luckily, one of your fellow students just finished writing their own version of an Item class. If the Item class was properly designed as a(n) _____, you do not need to know the specific details of how the class was implemented. Instead, you only need to become familiar with its _____.

abstract class; abstract methods

object-oriented instance; method implementations

black box system; interface

interface; inheritance hierarchy



Question 9
5 pts
(TCO 2) A class is designed with two public attributes: attributeOne and attributeTwo. attributeOne is an integer data type while attributeTwo is a string data type. Which pseudocode representation(s) of setters would be appropriate for this class?

int setAttributeOne(int newAttributeOne)
      {
return attributeOne
      }

void setAttributeOne(int newAttributeOne)
      {
attributeOne = newAttributeOne
      }

string setAttributeTwo (int newAttributeTwo)
      {
attributeTwo = newAttributeTwo
}

void setAttributeTwo ()
      {
attributeTwo = " "
}

Both A and C

None of the above



Question 10
5 pts
(TCO 7) Which of the following statements is false?

A pure virtual function is a function without function implementation and can be found in an abstract class.

If a derived class extends an abstract base class, the derived class must implement the pure virtual functions declared in the abstract base class.

Any method in an abstract class is considered a pure virtual function.

Pure virtual functions are inherited.

Explanation / Answer

1) D) Material()

2) B) client side access to implementation details.

3) C) Constructors

4) A) A private (helper) method can only be used inside the class. It cannot be called through an object of the class.

B) The programmer can control the scope of a data member of a class using access specifiers.

5) E) Only A and C

6) A) Member methods are the means by which you implement the behavior of a class.

C) Objects are created during program execution and eventually destroyed.

7) B) Create a Make class and a Model class and integrate them into Automobile using composition.

8) A) abstract class; abstract methods

9) B) void setAttributeOne(int newAttributeOne)
      {
attributeOne = newAttributeOne
      }

10) C) Any method in an abstract class is considered a pure virtual function.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote