Create a class named MagazineSubscription. Include fields for the subscriber (use the Person class you created in Exercise 1) and the subscription’s start and expiration dates (use the Date class you created in Exercise 2). Include a constructor that takes three arguments—a Person and two Dates. Also include a display function that displays MagazineSubscription fields by calling the Person and Date display functions. Write a main()function in which you instantiate a Person object and two Date objects. Use these as arguments to the constructor that instantiates a MagazineSubscription object. Display the MagazineSubscription object. Save the file as MagazineSubscription.cpp.
Exercise 1
Create a Person class that includes fields for last name, first name, and zip code. Include a default constructor that initializes last name, first name, and zip code to “X” if no arguments are supplied. Also include a display function. Write a main()function that instantiates and displays two Person objects: one that uses the default values, and one for which you supply your own values. Save the file as Person.cpp. You will use the Person class in other exercises.
Exercise 2
Write the class definition for a Date class that contains three integer data members: month, day, and year. Include a default constructor that assigns the date 1/1/2000 to any new object that does not receive arguments. Also include a function that displays the Date object. Write a main()function in which you instantiate two Date objects—one that you create using the default constructor values, and one that you create using three arguments—and display its values. Save the file as Date.cpp. You will use the Date class in other exercises.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.