Question
Asked by:
mahsan
mahsan
Rating : No Rating
Questions Asked: 9
Tutorials Posted: 0
 

$10.00 LibraryItem class

Q:
a) Attributes title, author, media, status, cost. Choose appropriate data types.
b) Code a constructor to handle all 5 inputs.
c) Code another constructor to handle title and author only. Set default values otherwise.
d) Code methods to set media, status and cost.
e) Code a method to display author and title of all overdue items.
f) Code a method to display all data of an object.

The LibraryItem class should have an LibraryItemTest class to run it. In this class build 4 LibraryItem objects and run all methods to test that the methods work.
 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$10.00 LibraryItem.java & LibraryItemTest.java w/ all constructors demonstrated.

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on May 25, 2008 at 5:40:24PM
A:
Preview: ... structAllItems();<br> showItems(A);<br><br> LibraryItem B = new LibraryItem("Joy of Cooking",<br> "Rombauer & Becker");<br> B.setCost(29.99);<br> showItems(B);<br><br> LibraryItem C = new LibraryItem();<br> C.setTitle("Programming the TI-83 Calculator");<br> C.setAuthor("Multiple authors");<br> C.setMedia("Hard Cover");<br> C.setStatus("Overdue");<br> C.setCost(17.35);<br> showItems(C);<br><br> LibraryItem D = new LibraryItem();<br> D.setTitle("C++ Programming");<br> D.setAuthor("Walter Savage");<br> D.setMedia("Soft cover");<br> D.setStatus("Overdue");<br> D.setCost(36.00);<br> showItems(D);<br><br> LibraryItem[] Stock = new LibraryItem[4];<br> Stock[0] = A;<br> Stock[1] = B; ...

The full tutorial is about 1139 words long plus attachments.

Attachments:
LibraryItemTest.java (2K) (Preview)
LibraryItem.java (1K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty