Enable contrast version

Tutor profile: David C.

Inactive
David C.
Tutor for two years in Computer Science/Mathematics.
Tutor Satisfaction Guarantee

Questions

Subject: Java Programming

TutorMe
Question:

Given the following: public void changeMyNum (int myNum) { myNum = myNum; } Assume the method changeMyNum is in a class called MyClass which contains a field also called myNum. Will the field myNum in the class be updated by the above method?

Inactive
David C.
Answer:

No. In the above method changeMyNum, myNum is set to itself. In this case we see an issue with scope versus naming conventions. Since there is a locally scoped variable with the same name as a member field, the most specific, or in this case the locally scoped, variable will be updated. This means that myNum (the parameter) will assign its value to itself without ever interacting with the class field myNum. To resolve this, you could use either of the following statements as a replacement: this.myNum = myNum; or myClassNum = myNum; Both statements will work around the naming convention issue we see in the original question, either by naming the variables two different names, or by specifically invoking the "this." keyword which scopes myNum to use the instance-level field instead.

Subject: Software Engineering

TutorMe
Question:

What is the difference between the Waterfall model and the Agile model of software engineering? Advantages and Disadvantages?

Inactive
David C.
Answer:

The key conceptual difference between the two engineering models is that the Waterfall approach expects rigorous documentation and planning before development begins. With the Waterfall approach, you follow a linear life cycle, which is extremely structured. Agile, on the other hand, there exists a continuous iteration of development and testing throughout the engineering process. Agile breaks its planning stages into multiple "sprints," meaning that adaptation and iteration is more possible. This creates one key advantage of Agile, which is that the customer sees a working product more frequently and can thus provide feedback more easily as compared with Waterfall. A disadvantage of Agile is that, depending on the team involved and the client's requests, you can suffer from "scope creep," where the client adds more and more changes or features to an ever-growing list, and the project loses its original scope.

Subject: C++ Programming

TutorMe
Question:

Object-Oriented Programming in C++: What is the difference between a class and an object in C++? Why does this not apply to C?

Inactive
David C.
Answer:

Since C++ is an object-oriented language, it is capable of supported classes and thus objects. The difference between the two is that a class is essentially a user-defined data type, similar metaphorically to a blueprint. It can contain variables (also called data members or fields) and member functions which act upon instances of that class. When a class is instantiated, this is called an object, and herein lies the difference. You can have multiple objects or instances of a certain type of class, but there is only the one original "blueprint," which is the class itself. Conceptually, it would be the same as having multiple primitive int variables: a, b, c. These may hold different integer values, but they are all of the type "int." This doesn't apply to C, because C does not support classes (it is a procedural programming language, not object-oriented).

Contact tutor

Send a message explaining your
needs and David will reply soon.
Contact David

Request lesson

Ready now? Request a lesson.
Start Lesson

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 Lesson" 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.
BEST IN CLASS SINCE 2015
TutorMe homepage
Made in California by Zovio
© 2013 - 2021 TutorMe, LLC
High Contrast Mode
On
Off