shalson
Jul 25, 2013, 03:57 AM
Create anabstract class named that includes private fields for the International Standard Book Number(ISBN),price, author and a protected field title. Include properties for each field. (An ISBN is a unique number assigned to each published book.) Provide publicget and set accessors for each field.Create a child class named that includes a private grade level field, and a childclass that contains no aditional fields.(Note: You yourself have to decide on the data type and name of the field.)The following class diagram demonstrates the scenario. Include a getTitle abstract method (which is just an
accessor method) in the Book class and override this method in its subclasses.
<<base>>
Book
TextBook
CoffeeTableBook
In the child classes, overide the accessormethodofa sprice so that s must be pricedbetween $20.0 and $80.0, inclusive, and themust bepriced between $35.0 and$10.0, inclusive.Also provide get and set accessors forgrade levelfieldin theclass named .Overloadconstructors for allclasses.
Design two User Interfaces (forms):ILoginandIBook.
TheILoginwill be used to get access to the IBook interface. Once successfully logged-in the IBookinterface should be displayed. (Use the following data for LoginUserName: User1; Password:
passwd )
respectively.Use Either JLabel,JTextField and JButton ortheJOptionPane instead, fordata entry, i.e.setting values for the datamembers andoutputthevaluesof allthe data membersin anicely formattedfashion.(Note: youyourself have to anticipatethe display of the interface)You are only required to validate the Books price in TextBook and CoffeeTableBook Classes. Assume that the
user does the other work (entry) correctly i.e. no other error handling is required.
for eachsuper & subclassmethod to describe what the method is doing when invokedbythe mainprogram.Also writeyourstudent Id number, name and program of study at the top of theJFrame classusing comments.
accessor method) in the Book class and override this method in its subclasses.
<<base>>
Book
TextBook
CoffeeTableBook
In the child classes, overide the accessormethodofa sprice so that s must be pricedbetween $20.0 and $80.0, inclusive, and themust bepriced between $35.0 and$10.0, inclusive.Also provide get and set accessors forgrade levelfieldin theclass named .Overloadconstructors for allclasses.
Design two User Interfaces (forms):ILoginandIBook.
TheILoginwill be used to get access to the IBook interface. Once successfully logged-in the IBookinterface should be displayed. (Use the following data for LoginUserName: User1; Password:
passwd )
respectively.Use Either JLabel,JTextField and JButton ortheJOptionPane instead, fordata entry, i.e.setting values for the datamembers andoutputthevaluesof allthe data membersin anicely formattedfashion.(Note: youyourself have to anticipatethe display of the interface)You are only required to validate the Books price in TextBook and CoffeeTableBook Classes. Assume that the
user does the other work (entry) correctly i.e. no other error handling is required.
for eachsuper & subclassmethod to describe what the method is doing when invokedbythe mainprogram.Also writeyourstudent Id number, name and program of study at the top of theJFrame classusing comments.