Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I would like assistance with this Thanks in advance Figure I depiets the classes to which you will interfice while completing the exereise. 1.

Hi I would like assistance with this Thanks in advance image text in transcribed
image text in transcribed
Figure I depiets the classes to which you will interfice while completing the exereise. 1. In class Singer,: a. Complete the first constructor that accepts name, genre, budget, as well as a reference to the Ministryincoming 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 getEstfarnings 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 getsongfartEst/hint. the singer keeps a reference to the ministry. You can observe how the reference is used in method getClaimabieEarnings). 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 repioter the song a. In class Song write a mutator named setStudio|Studio studiol -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 tryToRiegister5one, it the singer has a preferred studio, set studio to the preferred studio (use method setstudio0), then add the song to the list of registered songs. 5. In class Singer, method tryTofiegisterSond, update logic to check if artist can afford studio before setting the studio on the song. 6. In class Singer, method tryToRegister5ong, update logic to allow 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 nulli) 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 isfivallablel) method in the studio class) before assigning the song to the studia. Figure 1 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 gence, and b for budget). b. Implement the second constructor so that all instance variabies are initialized. 2. In class Song, write the caiculation 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 getSongPartEstfhint. the singer keeps a reference to the ministry. You con observe how the reference is used in method getClaimobleEarnings). 3. In class Singer, correct the method sumEstEarnings to evaluate the sum of estimates eamings 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(5tudio 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 tryTokegistersong, If the singer has a preferred studio, set studio to the preferred studio (use method setstudio0), then add the sons to the list of registered songs. 5. In class singer, method tryToRegistersone, update logic to check if artist can afford studio before setting the studio on the song. 6. In class singer, method tryToRegisterSone update logic to allow ministry to suegest a studio by calling the method getBestAvailablestudiolint budget, Studio preferred) from Ministry, which retums a suggested studio. If the method returns a studio (returned value is not null) 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 resenve method when adding a song to the list of registered songs. Also, check to see if a studio is available (using the isAvallable) 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

Managerial Accounting

Authors: Ronald W Hilton

7th Edition

0073022853, 978-0073022857

Students also viewed these Databases questions

Question

I send you this homework, I hope you will accept perform. Thank you

Answered: 1 week ago