Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with exercises 1 and 2 Lab 7 - Interfaces 1. Define an interlace ealed Borrowable which wall be implementod by any medis clnss

Please help with exercises 1 and 2

image text in transcribedimage text in transcribed

Lab 7 - Interfaces 1. Define an interlace ealed Borrowable which wall be implementod by any medis clnss of objects thnn can be benowed from the library (CD, DVD, 7.0, Lab Goals magazine, cte-. Borrowable intertace contains 3 dbcthods: - Declare nnd use final Merhods avd Classes - vo1d checkout(5tring borrowerName, String duedate): - Create and use interlaces performs any medin object's cherkour - vaid returned() perfonm medin object's return - String Eetstatus() returns the stanas of the meatia (loomoded or in the sheit) 7.1. Recall 2 Mnke Circulati ngBank implements Borrawable interfuce and perform the - A final class cannot bave any subclass. uocessary modificatious in the classcs L1bramy Book atd Referencebook. - A fiaal method cannot be oferridder by subclasses. ,i. Do we really need to keep the class LibraryBpok? Justify your ansper. - An interface defines a list of puhlic abstract methods thar have to he 4. Updale checkeoul ard relurnel nuethed af the class Labrary ta be applieable anly inplemented in the suhclassec. The presence of the keywords public and on the Borrawable abjects. absrract is cotioual. 5. Define anotber interfnex ealled 5alable which will be impleneated by any media object that ean be sold anline. Salable interface contains 2 methnds: 7.2. Exercise 1 - boolean isanailable() iodicars whetber the medin object is availahle for sale ar not. Consider the classes of the 1 ab f(6 provited with this exercise. Select the classes - double computecost(): computes and scturrs the cost of the ibodia (exactly 4) that you qualified to be final, change their declamarion, and compileiexecure object the test prograns (L1braryTest, L1braryTestz, and PurchaseTest). 6. According to you, what is the tuest appropeiate class that sill inplement the Also, you ean decide some of the metheds to be fical and modify their doedaration. Salable intarface? Update your selected class. 7. Update Purchace clase to prosess Salable objects (not just SalableBpok). luecatily the eventual compile-lime entuns (il any) and try to resolve them. Ilin:: change any method, variable, and string cun.ent containing the word hook with the word item. 8. Compile and tes: your modification using LibraryTest, Library Test2, and 7.3. Exercise 2 PurchaseTest (chese classes are also subject to noodificatioa) In this exercise you will make a ne's design of the class hierarchy of I ab 06by 9. Imagine abother interface, define it, make some classes implement it, preform introducing intetfaess. the nocessary modifications, test yout new iaterfaes. Lab 7 - Interfaces 1. Define an interlace ealed Borrowable which wall be implementod by any medis clnss of objects thnn can be benowed from the library (CD, DVD, 7.0, Lab Goals magazine, cte-. Borrowable intertace contains 3 dbcthods: - Declare nnd use final Merhods avd Classes - vo1d checkout(5tring borrowerName, String duedate): - Create and use interlaces performs any medin object's cherkour - vaid returned() perfonm medin object's return - String Eetstatus() returns the stanas of the meatia (loomoded or in the sheit) 7.1. Recall 2 Mnke Circulati ngBank implements Borrawable interfuce and perform the - A final class cannot bave any subclass. uocessary modificatious in the classcs L1bramy Book atd Referencebook. - A fiaal method cannot be oferridder by subclasses. ,i. Do we really need to keep the class LibraryBpok? Justify your ansper. - An interface defines a list of puhlic abstract methods thar have to he 4. Updale checkeoul ard relurnel nuethed af the class Labrary ta be applieable anly inplemented in the suhclassec. The presence of the keywords public and on the Borrawable abjects. absrract is cotioual. 5. Define anotber interfnex ealled 5alable which will be impleneated by any media object that ean be sold anline. Salable interface contains 2 methnds: 7.2. Exercise 1 - boolean isanailable() iodicars whetber the medin object is availahle for sale ar not. Consider the classes of the 1 ab f(6 provited with this exercise. Select the classes - double computecost(): computes and scturrs the cost of the ibodia (exactly 4) that you qualified to be final, change their declamarion, and compileiexecure object the test prograns (L1braryTest, L1braryTestz, and PurchaseTest). 6. According to you, what is the tuest appropeiate class that sill inplement the Also, you ean decide some of the metheds to be fical and modify their doedaration. Salable intarface? Update your selected class. 7. Update Purchace clase to prosess Salable objects (not just SalableBpok). luecatily the eventual compile-lime entuns (il any) and try to resolve them. Ilin:: change any method, variable, and string cun.ent containing the word hook with the word item. 8. Compile and tes: your modification using LibraryTest, Library Test2, and 7.3. Exercise 2 PurchaseTest (chese classes are also subject to noodificatioa) In this exercise you will make a ne's design of the class hierarchy of I ab 06by 9. Imagine abother interface, define it, make some classes implement it, preform introducing intetfaess. the nocessary modifications, test yout new iaterfaes. Lab 7 - Interfaces 1. Define an interlace ealed Borrowable which wall be implementod by any medis clnss of objects thnn can be benowed from the library (CD, DVD, 7.0, Lab Goals magazine, cte-. Borrowable intertace contains 3 dbcthods: - Declare nnd use final Merhods avd Classes - vo1d checkout(5tring borrowerName, String duedate): - Create and use interlaces performs any medin object's cherkour - vaid returned() perfonm medin object's return - String Eetstatus() returns the stanas of the meatia (loomoded or in the sheit) 7.1. Recall 2 Mnke Circulati ngBank implements Borrawable interfuce and perform the - A final class cannot bave any subclass. uocessary modificatious in the classcs L1bramy Book atd Referencebook. - A fiaal method cannot be oferridder by subclasses. ,i. Do we really need to keep the class LibraryBpok? Justify your ansper. - An interface defines a list of puhlic abstract methods thar have to he 4. Updale checkeoul ard relurnel nuethed af the class Labrary ta be applieable anly inplemented in the suhclassec. The presence of the keywords public and on the Borrawable abjects. absrract is cotioual. 5. Define anotber interfnex ealled 5alable which will be impleneated by any media object that ean be sold anline. Salable interface contains 2 methnds: 7.2. Exercise 1 - boolean isanailable() iodicars whetber the medin object is availahle for sale ar not. Consider the classes of the 1 ab f(6 provited with this exercise. Select the classes - double computecost(): computes and scturrs the cost of the ibodia (exactly 4) that you qualified to be final, change their declamarion, and compileiexecure object the test prograns (L1braryTest, L1braryTestz, and PurchaseTest). 6. According to you, what is the tuest appropeiate class that sill inplement the Also, you ean decide some of the metheds to be fical and modify their doedaration. Salable intarface? Update your selected class. 7. Update Purchace clase to prosess Salable objects (not just SalableBpok). luecatily the eventual compile-lime entuns (il any) and try to resolve them. Ilin:: change any method, variable, and string cun.ent containing the word hook with the word item. 8. Compile and tes: your modification using LibraryTest, Library Test2, and 7.3. Exercise 2 PurchaseTest (chese classes are also subject to noodificatioa) In this exercise you will make a ne's design of the class hierarchy of I ab 06by 9. Imagine abother interface, define it, make some classes implement it, preform introducing intetfaess. the nocessary modifications, test yout new iaterfaes. Lab 7 - Interfaces 1. Define an interlace ealed Borrowable which wall be implementod by any medis clnss of objects thnn can be benowed from the library (CD, DVD, 7.0, Lab Goals magazine, cte-. Borrowable intertace contains 3 dbcthods: - Declare nnd use final Merhods avd Classes - vo1d checkout(5tring borrowerName, String duedate): - Create and use interlaces performs any medin object's cherkour - vaid returned() perfonm medin object's return - String Eetstatus() returns the stanas of the meatia (loomoded or in the sheit) 7.1. Recall 2 Mnke Circulati ngBank implements Borrawable interfuce and perform the - A final class cannot bave any subclass. uocessary modificatious in the classcs L1bramy Book atd Referencebook. - A fiaal method cannot be oferridder by subclasses. ,i. Do we really need to keep the class LibraryBpok? Justify your ansper. - An interface defines a list of puhlic abstract methods thar have to he 4. Updale checkeoul ard relurnel nuethed af the class Labrary ta be applieable anly inplemented in the suhclassec. The presence of the keywords public and on the Borrawable abjects. absrract is cotioual. 5. Define anotber interfnex ealled 5alable which will be impleneated by any media object that ean be sold anline. Salable interface contains 2 methnds: 7.2. Exercise 1 - boolean isanailable() iodicars whetber the medin object is availahle for sale ar not. Consider the classes of the 1 ab f(6 provited with this exercise. Select the classes - double computecost(): computes and scturrs the cost of the ibodia (exactly 4) that you qualified to be final, change their declamarion, and compileiexecure object the test prograns (L1braryTest, L1braryTestz, and PurchaseTest). 6. According to you, what is the tuest appropeiate class that sill inplement the Also, you ean decide some of the metheds to be fical and modify their doedaration. Salable intarface? Update your selected class. 7. Update Purchace clase to prosess Salable objects (not just SalableBpok). luecatily the eventual compile-lime entuns (il any) and try to resolve them. Ilin:: change any method, variable, and string cun.ent containing the word hook with the word item. 8. Compile and tes: your modification using LibraryTest, Library Test2, and 7.3. Exercise 2 PurchaseTest (chese classes are also subject to noodificatioa) In this exercise you will make a ne's design of the class hierarchy of I ab 06by 9. Imagine abother interface, define it, make some classes implement it, preform introducing intetfaess. the nocessary modifications, test yout new iaterfaes

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

7. Explain how an employee could reduce stress at work.

Answered: 1 week ago