Should be able to output the sample output provided if given sample input
\begin{tabular}{|l|l|} \hline +getStudio0 & \begin{tabular}{l} -name \\ +getSongPartEst0 \\ +getBestSelLimit0 \\ +getBestAvailStudio0 \\ -gost \\ -freetime \\ -record Time \\ \hline +geaNiame0 \\ +getCost? \\ +getFree Time0 \\ +reserve0 \end{tabular} \\ \hline \end{tabular} \begin{tabular}{|l|} \hline -fame \\ - budget \\ - -ongs \\ -favStudio \\ - -ministry \\ - genre \\ - grantValue \\ -grantMessage \\ +getName0 \\ +tryToRegister Song0 \\ +getDudget) \\ +getSongs0 \\ +getMinistry0 \\ +studioExists0 \\ +canAtford0 \\ +getTotalEarnings0 \\ \hline \end{tabular} 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 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 getClaimableEarnings). 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 allow ministry to suggest a studio by calling the method getBestAvailableStudio(int budget, Studio preferred) from Ministry, which returns 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 reserve method when adding a song to the list of registered songs. Also, check to see if a studio is avallable (using the isAvailable() method in the studio class) before assigning the song to the studio. Sample Input 7 7500000020000020000500000YesYes \[ \text { Iron_Balloon Waan_Buss } 25000 \text { Yes } 0 \] 3 Wha? Yow! Far_In_Wi_Seh! Shen_Yengz Dancehall 100000 Yes 2 2 Youre_the_one_I_tove_so_I_will_run_run_run Lighter Agent_Sasco Dancehall 140000 Yes 3 5 Banks_of_the_Hope Winning_right_now Mama_Prayed Sasco_vs_Assassin Loco Adele Soul 400000 Yes 2 Go_easy_on_me Water_under_the_bridge_when_we_were_young Tessanne_Chin Rock 400000 Yes 2 Messenger One_Step_Closer Tracy_Chapman Blues 400000 Yes 3 All_that_you_have Fast_Car Subcity Poppy DanceHall 500000 Yes 3 1 Unrulyrulyrulyrulyrulyrulyrulyrulyrulyrulyrulyrulyruly!!!! Sample Outpu? Helwiet what as' a maan linss single te eare set,nes. Areistering whel oith hedent ias, Mate, Preters leff begt btes ing rel aigh bidert tis, ate, prefers burt irbtudie brin ia aneitable far 120, tieat. hidgitis Hate in anitale for sae, aes: kobus than io asa babte for tied, loen. imhwiget sludie meft twit. serener Aingisi ta 4urn ieut, ess. Bhanigud atucie Matf fong. sineser kamr_akcoiedetere masic) if Seren (s) Tetet eirnible ter ienet, Iesto in 11,33, teet masiciavariablascest [abi, obeli. heuff bard to avartable for tili, ane, khaviaed atudie thuff bong. kiderf Consia met asanterti. Begisterifg Saace_es kesasin of breyff bedecta not anevibile hibuff lengia met asateble. postuatio orit is ansilaste far we, 0en. wistich IIntertainest in mentable fer sen, kee. miginte macte is anablable fey jabgate. brabterea atudie tichtis mabte. Stmen iatufnt Somata] warn rade,net Tatal earnable for Tracy_Chapnan = \$640, ebe 3)Ruff Gongis not avat lable. 3sstudie oneis not avaliable. D) hich. Entertainent is available for 560,000 . 3)Assighed studie afch Cntertainnent. Gegistering Fast_Car with budget 5340,000 . Wo preferred studle. 3xRuff Congis not available. astudte Oneis not ayailabte. 3) Rich Entertainmentis not avaslable. 3)Etighe7e Masie is avaitabte for 550,000 . b)Assigned stiadie Eightof Musie. aegistering subcity with budget $260,000. No preferred stumio. >>Ruff Congis not available. mstudie oneix not avaflable. D) Rich Entertainentis not araitable. 3)Eightic Music is available for 550,000 . P)Assigned studio Eight76 Music. 32processing request frn fracz_chapean for $640,000 Singer Poppr [ [ighetg Auste ]=; Song(s) Aeteased * Darutyrutyrutyrotyrutyrutyrutyrutyrutyrutyrutyrutyruty 111 as a bancetiall single to earn $1,160,000, fotal earnabte for Poppy =$1,160,600 meetstering unrulyrulyrutyrulyrutyrulyrutyrutyrulyrutynatyrulyruty 111m eh budget 5500,009 . Frefers cight7s Music (hvavlable tcost (100,000)}. >>Processiog request from Poppy for 51,160,000 SHEN_YENGz[Kich Entertainnent] f :GMaMTED sAd, ,6e0 SONCS SUPPORTED. Meleased *roure_the_one_1_tore_so_1_mit1_rut_run_run as a Bancehatl sincte to earn 5840n940. Aeleased Lighter as a Dancehati single te parn $140, 000. MGENT_SASCo [Elgbt 76 - Music] \& LGbasteD $1,240,400 SONCS SUPPORTED Released banks,ef_the Hope as a Dancehati siegle to eara s3.40,000. Reteased Winninfiright ance as a Dancehall singte to earm 1349,006 . Rieleased Mana_prayed as a Dascthatl singte to earn 5236,000 . aeteased sasce.ive.Assassin as a Dancehalt stegte to eare 5344,000 . MELETTGENIED \$1, 360, e00 SONCS SUPPORTED the leased Gojeasy. an me as a Sout single to earn 5260,600 . tarn 5620,960 . TESSAANE,CNTN: ; CRANTED 5430,000 SONGS. SUPPORRED Released Messenger as a bock single to earn 51110,000 . Released One step_closer as a pock single te earn $300;000. TAACY CHAPEAN: L GRANTED 1640,006 soncs 9WPPoRTed Rieleased Alt_that you_have as a 8 toes singte to earn $340,600. heleased fast.Car at a btuek single to earn $160,600, Reteased Subcity as a Bties singte to earn 1146, 000 ; IAON_BaLloovfRuff Gong]:zkequest for $160,009 declinediaminimum intellectial groperty for grants is 5260, eme Boppr[Eight ts Masiclatkequest for $1,169, bob ewclinedtiesutfictent funde in grant poot