The Primary Purpose of This Assignment Is to Get Experience Using the Java Skills Learned

Total Page:16

File Type:pdf, Size:1020Kb

The Primary Purpose of This Assignment Is to Get Experience Using the Java Skills Learned

Computer Science 1260 April 5, 2018Project 1 – Book Class Due: ______

Purpose The primary purpose of this assignment is to get experience using the Java skills learned in CSCI 1250 with the new tools (Eclipse and Astah) introduced in 1260. Most of the Java you need to know was presented in 1250. The context of this assignment is a BookManager application. It involves the creation of a Book class and a Driver class to handle input/output concerning the features of the Book class. The assignment involves designing, coding, debugging, and completely testing the application.

Specifications The Book Class  Each Book has a title, a price, up to 4 authors, and a cover photo. Each Book object will maintain the number of authors. Each Book has a BookType as well, with possible types being Fiction, Biography, History, Reference, and Other.  The title is a String, the price is a double, and an array of Strings is used to hold author names. The cover photo is a String giving a relative path to a file containing the photo (such as “Covers\Java Is Fun.jpg”).  The BookType will be represented with an enumerated data type, and the BookType enumeration should be in its own .java file (not part of any class).  Some books may have no specified authors. A dictionary is an example of such a book.

 Each attribute of a Book object should have its own getter/setter, allowing the driver to retrieve or modify the values of the attributes.  The Book class must have its own toString method that returns a formatted string containing the information about the book that can be displayed by the driver, for example. This formatted string should provide a reasonably professional and user friendly appearance to the book information. The price should be formatted as local currency using a currency formatter such as NumberFormat fmt = NumberFormat.getCurrencyInstance ( );  The Book class should do NO input or output. The Driver Class  The primary purpose of the Driver class is to handle all input and output (that is, all interaction with the user of the program) in demonstrating the capabilities and features of the Book class.  The main method in the Driver class should consist primarily of calls to other static methods in the Driver class.

 The other static methods in the Driver class should each handle one primary task. For example, a method named getBookInfo may contain prompts for the user to enter a title, price, authors, and so forth, and the method would return an appropriate Book object. A static method named displayBook might display a Book object using its toString method.  The driver should display a welcome message when the application begins that includes the name of the project and its number, the purpose of the project, and the author (with contact information) of the project. It should also provide a brief description of the purpose of the project.

CSCI 1260 – Project 1 Page 1 Computer Science 1260 April 5, 2018Project 1 – Book Class Due: ______

 The prompts for input of Book information should be handled with appropriate JOptionPane dialogs (Message Dialog, Input Dialog, Confirmation Dialog).  The driver will display a goodbye message (using a Message Dialog) that includes the number of books processed during the session. Project Design and Testing Strategy  Using the posted document Design Document and Example to guide you, create a design document for the project before you begin coding. This design document includes both the project design and the testing strategy to verify that the final project meets all specifications. You must read the specified document to understand what is required here.  The design and testing strategy is due prior to the final project. See the web site for details.

Documentation

 Proper documentation of your project is required. See the document IMPORTANT: Documentation Policy posted on the web site for the detailed requirements.  Penalties for failure to document properly and completely are severe. Complete documentation is REQUIRED.

 If Eclipse has been set up as we did in the lab and if it is used as we did in the lab demonstration, it will do much of the file/class/method header documentation for you (but you still need to fill in the missing parts (such as the purpose of a method)). Single line comments within a method are also important and should not be ignored, but they should be used where additional explanation helps a reader – not on every line.  Proper naming of packages, files, classes, methods, attributes, and other variables are part of good documentation.

Project Submission Project submission will be done in two stages. 1. Submit your initial design and test strategy prior to beginning to code. 2. Submit your updated design along with the final, fully documented, tested, and working java program. All appropriate files will be zipped and submitted together. See the Course Facts documents for detailed instructions on what to include, how to name your submission, and other details. Due dates for the initial design and the final submission are posted on the web site.

CSCI 1260 – Project 1 Page 2

Recommended publications