Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 2 table [ [ Singer , MusicCD,Customer ] , [ Sname: string,title: string, ] , [ , table [ [ yearRealeased :

Task 2
\table[[Singer,MusicCD,Customer],[Sname: string,title: string,],[,\table[[yearRealeased : int],[SingerName]],\table[[Name: string],[buysMusicCD (5)]]],[Singer0,,],[printSinger0: void,MusicCD0,\table[[Customer(string)],[printCust(0)void]]]]
MusicCD belongs to only one singer.(MusicCD class contains an object of Singer class)
Name of the customer should be accepted as parameter from main(), all other attributes (of the other classes) should be entered through the keyboard.
Customer buys 5 Music CDs.(Customer class contains an array object of MusicCD class)
Sample Output:
\table[[Customer Name: Johny Malkowich],[Title: Paradise,Year Released: 1998,Singer Name: Tanita Tikaram],[Title: Sun Lee,Year Released: 2013,Singer Name: Sun Lee],[Title: Red Moon,Year Released: 2010,Singer Name: Mary Black],[Title: Lonely,Year Released: 2015,Singer Name: David Husseloff],[Title: Sahaj Love,Year Released: 2014,Singer Name: Nirmala Devi]]
a. Write C++ code to design each class.
b. Write main function that will do the following steps:
Create an object for customer class. (If necessary, create objects for other classes as well)
Call the necessary method(s) to print the details of customer as shown in the sample output above.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

Say s = hello what will be the return value of type ( s ) ?

Answered: 1 week ago