Word Problem: John begins his day at a fruit-selling stand with sixty pieces of fruit. He sells ten of those pieces and divides the remaining pieces among his ten friends. How many pieces does each of them receive?
There were originally sixty; ten were sold and the remainder divided by ten. (60 - 10) / 10 = 5. Each friend received five pieces.
Theory: explain the difference between object-oriented programming and functional programming methodologies.
Object-oriented programming's goal is to consolidate data and behavior together into objects that can be manipulated. Functional programming sees data and behavior as separate and proceeds in a manner that keeps them apart.
Inheritance: you have a parent class "BaseClass" and you want to create a derived class named "MyClass". Type the C++ code required to declare MyClass (Note: no need to implement the class, only to declare it). Ensure this code properly inherits the public member functions & data of BaseClass.
class MyClass : public BaseClass {};