In this assignment you are given a class representing a street address called Address which is used to describe the location of newspaper subscribers. You are required to create an abstract class...

3 answer below »

In this assignment you are given a class representing a street address calledAddresswhich is used to describe the location of newspaper subscribers. You are required to create an abstract class calledNewsPaperSubscriber, and create three child classes that are derived from it.The three child classes represent three types of newspaper’s subscribers: weekly subscribers receiving the newspaper daily, weekdays subscribers receiving the newspaper everyday except on weekends, and weekend subscribers receiving the newspaper on weekends only. The three child classes are calledWeeklySubscriber,WeekdaysSubscriber, andWeekendSubscriber, respectively. The class definitions are as follows:





  • NewsPaperSubscriberhas two data members: a subscriber’s street address (st_Address) and the subscription rate (rate). Include two constructors, one initializes the class object without passed parameters, and another that receives one parameter to initialize the street address. Include getter and setter methods for the data members. The setter method,setRate(), for the rate is abstract. Include an abstract method, calledprint(), that does not return a value and does not receive any parameters. Theprint()function is to be used for displaying a subscriber's information: address, rate, and service type. Also, include anequals()method that indicates two subscribers are equal if they have the same street address. Theequals()function returns a Boolean and receives aNewsPaperSubscriberpointer parameter.


  • Create the three child classes of theNewsPaperSubscriberclass,WeeklySubscriber,WeekdaysSubscriber,WeekendSubscriber. Each child class has a constructor that accepts a parameter to initialize the street address and calls thesetRate()method to set the rate as follows:


  • WeeklySubscriberpays $10.5 per week.


  • WeekdaysSubscriberpays $7.5 per week.


  • WeekendSubscriberpays $4.5 per week.


Note: Each child class must implement the parent’s abstract methods. See the given examples for the format of displayed information of a subscriber.


Implement each class in a separate header file that carries the class’s name, such as: “NewsPaperSubscriber.h”, “WeeklySubscriber.h”, etc.










must run code on provide tool. video navigate you where to run code.


for my canvas user id uscid - pp222, password- Princep411$


must read all attachment. get scored 5 out of 5 please

Answered 4 days AfterApr 19, 2022

Answer To: In this assignment you are given a class representing a street address called Address which is used...

Robert answered on Apr 23 2022
104 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here