Problem 1
Problem 1
and recursion.
Implement the following classes:
1- Declare the class Publication with 2 members: owner, which is a string, and price, which is a double.
Members of this class must be accessible only by its subclasses. Inside this class, do the following:
a. Write a constructor for this class that initializes all members from its parameters.
b. Write a getter for every member of the class.
c. Write a setter for every member of the class.
d. Write the toString method that returns the details of all members in one string.
2- Declare the class Book as a subclass of the Publication class with one private string member ISBN and the
following methods:
a. Write a constructor for this class that initializes all the members, including superclass members, from
its parameters.
b. Write the toString method that returns the details of all members, including superclass members.
3- Declare the class NewsStand with two private data members: standName, which is a string, and pub, which is
a Publication. Inside this class, do the following:
a. Write a constructor for this class that initializes all the members from its parameters.
b. Write a getter method for standName.
c. Write the toString method that returns the details of all members in one string.