Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

begin{tabular}{|l|} hline +getStudio0 +getSongPartEst0 +getBestSellLimit0 +getBestAvailStudio0 hline end{tabular} begin{tabular}{|l|} hline -name -cost -freetime -recordTime hline +getName0

image text in transcribed
\begin{tabular}{|l|} \hline +getStudio0 \\ +getSongPartEst0 \\ +getBestSellLimit0 \\ +getBestAvailStudio0 \\ \hline \end{tabular} \begin{tabular}{|l|} \hline -name \\ -cost \\ -freetime \\ -recordTime \\ \hline +getName0 \\ +getCost0 \\ +getFree Time0 \\ +reserved \\ \hline \end{tabular} -grantMessage +getName0 +tryToRegisterSong0 +getBudge:0 +getSongs0 +getMinistry0 +studioExists0 +canAftord0 +getTotalEarnings0 Figure I depicts the classes to which you will interface while completing the exercise. 1. In class Singer;: a. Complete the first constructor that accepts name, genre, budget, as well as a reference to the Ministry(incoming arguments include n for the name, g for genre, and b for budget). b. Implement the second constructor so that all instance variables are initialized. 2. In class Song. write the calculation in method getEstEarnings of class Song to evaluate estimated earnings. Note that while in the real world, other methods would be used to estimate earnings, in this simplified model, the estimated earnings will be the length of the title, multiplied by the a value extracted by the ministry using the method getSongPartEst/(hint., the singer keeps a reference to the ministry. You can observe how the reference is used in method getCiaimableEarnings). 3. In class Singer, correct the method sumEstEarnings to evaluate the sum of estimates earnings for the singer. 4. Record a song in a studio and try to register the song a. In class Song write a mutator named setStudio(Studio studio)-method for the song that accepts a Studio, and sets the associated studio on the on the song to the referenced Studio. b. In class Singer, method tryToRegisterSong, if the singer has a preferred studio, set studio to the preferred studio (use method setStudio()), then add the song to the list of registered songs. 5. In class Singer, method tryToRegisterSong, update logic to check if artist can afford studio before setting the studio on the song. 6. In class Singer, method tryToRegisterSong, update logic to aliow ministry to suggest a studio by calling the method getBestAvailablestudiolint budget, Studio preferred) from Ministry, which returns. a suggested studio. If the method returns a studio (returned value is not nul) then set the studio for the song to the returned studio if the singer is able to afford it. You can then check if the song has been connected with a studio, and if it is, add the song to the list of registered songs. 7. In class Singer, method tryToRegisterSong, ensure singer's budget is reduced by the cost of the studio. 8. In class Singer, method tryToRegisterSong, call the Studio's reserve method when adding a song to the list of registered songs. Also, check to see if a studio is available (using the isAvailable() method in the studio class) before assigning the song to the studio

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

Progress Monitoring Data Tracking Organizer

Authors: Teacher'S Aid Publications

1st Edition

B0B7QCNRJ1

More Books

Students also viewed these Databases questions