Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Zac M.
Computer Science student who knows what help others need
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

Explain the difference between private and protected data members. When is a good time to use the protected modifier?

Zac M.
Answer:

A private data member can only be accessed by the members of the class. A protected member can be accessed only by the members of the class and its subclasses. The protected modifier is good to use when you need a subclass to have direct access to methods or variables in a superclass, but would not need a user to access those same variables or methods.

Music
TutorMe
Question:

Explain the construction of and define a diatonic chord, and a few different ways to modify the chord.

Zac M.
Answer:

A diatonic chord is a chord made up of only notes found in the key that one is working in. A diatonic chord is a triad consisting of the root, third, and fifth notes of the scale. So for example, a C Major chord (The key of C consists of the notes C D E F G A B) would consist of the notes C, E, and G. You can start anywhere in the scale and construct a chord, so starting at A we get A, C, and E, the notes of an A Minor chord. There are ways to spice up chords, such as suspending the third to a two or four, augmenting (raise by a half step) the fourth, or adding a major seventh (or two).

C++ Programming
TutorMe
Question:

What is a friend class? How does this differ from a friend function? When might friends be appropriate and what are the dangers?

Zac M.
Answer:

A friend class is a class that has access to the private members of another class. It is different than a friend function because the entire friend class has access, instead of one function. Friends are appropriate for operator overloading and if you have two classes, for example, child and mother, where anyone can ask the child’s name, but only the mother and child can change the name. Some of the disadvantages of using friend functions/classes are that they can break your encapsulation, a derived class can’t inherit friend functions, and since the friend function/class has access to otherwise private data members, there are security issues.

Send a message explaining your
needs and Zac will reply soon.
Contact Zac
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.