Introduction
:
,
:
,
Requirement
O BJECT -O RIENTED P ROGRAMMING
I NDIVIDUAL P ROJECT 03 - T HE L IBRARY
Project 03 Background
Write a console (text) program comprised of a main() class, CSC211Project03, a driver
class, Project03Driver, and your Textbook class.
The driver class should have
•
a data field that is a constant array of type String called SUBJECT_LIST and is initialized
to at least five different textbook subjects.
•
a data field, library, that is an array of Textbook objects. The library should contain
10,000 textbooks. (Though you may want to test it with 10 books until you’re sure the
driver functions correctly.)
• The driver class constructor should instantiate the array, library, and fill it with random
Textbook objects. Randomly select a subject for each Textbook from SUBJECT_LIST
and a random pageCount for each Textbook between 500 and 1500. (These are college
textbooks after all!)
The driver class should have the following methods:
• findHeaviest returns the weight of the heaviest textbook in the library
•
getHeaviest returns the index of the heaviest textbook in the library
•
computeAverageSize returns the average page count for all the textbooks
•
computeTotalPages returns the total number of pages in all the textbooks in library
• getLibraryStats calls all of the above methods and reports on the library’s stats,
including how many total textbooks are int eh library. This is the method called from the
main() class.
Project 3 Rubric
General (50 Pts):
• 10 pts - compiles and runs, no syntax errors
• 10 pts - all Project03Driver methods commented using javadoc style. comments
• 5 pts - main() class, CSC211Project03, is correct
• 5 pts - no magic numbers used with arrays
• 10 pts - all Project03Driver data fields correctly declared
• 10 pts - correct Project03Driver constructor implementation
Method implementation (50 Pts):
• Correct functionality in each method listed below is worth 10 points:
findHeaviest, getHeaviest,
computeAverageSize, computeTotalPages, getLibraryStats