Cmpt 225
Simon Fraser University
School of Computing Science
Cmpt 225 - Assignment #1
Library Management Application
Due: Monday, January 29 @ 23:59:59
Before We Start
The following is a list of topics we recommend you have a good understanding
of in order to successfully complete this assignment:
-
The Phases of the Software Development Process (see Course Material on
our course web site)
-
Object composition (also called "object containment" or "has-a" kind of
relationship)
-
How to implement classes and their methods
-
Arrays
-
Exception handling (see "About Exception Handling" section below)
-
I/O: Input from the keyboard and output to the console (monitor) - see
Chapter 1 of your textbook.
-
I/O: Input from a file (input file) and output to a file (output file)
You are free to select either Java or C++ when implementing your solution
to this assignment.
Objectives
In this assignment, you will gain experience performing the phases of the
software development process while developing an object-oriented program.
Additionally, this assignment gives you the opportunity to further hone
your skills at building classes, manipulating objects in a Java (or C++)
program, and using exception handling. Furthermore, in this assignment,
you will learn to use various I/O Java (or C++) mechanisms.
Problem Statement
In this assignment, you are to build an simplified version of a Library
Management Application. It is a "simplified version" because, as you will
soon see (or read), the set of its requirements is a subset of the requirements
of a typical Library Management Application.
Our Library Management Application (simplified version) must allow the
user to perform the following actions:
-
create a library resource,
-
modify any of the information related to this library resource (except
the author's last name),
-
delete a library resource,
-
display all the library resources (display only the title and author's
full name for each library resource) in alphabetical order of author's
last name,
-
select a library resource (by specifying the author's last name), and display
all the information for this library resource.
An library resource, in our Library Management Application (simplified
version), represents a book and it holds the following information about
this book:
-
ISBN
-
title
-
author's last name
-
author's first name
-
publisher
-
edition number
-
date of edition
-
library call number
-
number of pages
-
type of resource (the only possible values for this attribute are:
book, CD, periodical, movie, map).
Specific Requirements
In creating your Library Management Application (simplified version), you
must satisfy the following requirements:
-
You must have a class called Resource (Resource.java
OR Resource.h and Resource.cpp) as part of your Library Management
Application (simplified version) for the library resources.
-
You must use array(s) only (no vectors, no linked lists, no nothing that
is not an array).
-
When your data collection is full, your program must expand it in a transparent
fashion. This is to say that it cannot notify the user that the library
stack is full nor must it prevent the user from creating more library resources.
Instead, when your application senses that the data collection has reached
its maximum capacity, it must first expand it, and this expansion must
be unbeknown to the user, then it must store the new library resource the
user is creating into the newly expanded data collection.
-
The operation of displaying all the library resources (display only the
title and author's full name for each library resource) in alphabetical
order of author's last name, can be performed in O(n). This signifies that
the number of library resources your application accesses when executing
this operation must be linearly proportional to the total number of library
resources in your data collection representing the library stack. For example,
if there are 10 library resources in your "library stack", and the user
has selected the option of displaying all these library resources (display
only the title and author's full name for each library resource) in alphabetical
order of author's last name, your application must then only perform about
10 accesses into your data collection in order to execute this selected
option.
-
Duplicated author's last names are allowed. Make sure your application
orders them properly. For example: Anita Lee must be displayed before Yvan
Lee.
-
When searching for a last name, your data collection must be constructed
such that your application must not be searching all entries but only the
entries containing last names starting with the same first letter as the
first letter of the last name for which you are searching. For example,
if you are searching for "Lee", your application will not be searching
through all the library resources (library resources with author's last
names starting with the letter 'A', then 'B', etc.) but will search only
the library resources with author's last names starting with the letter
'L'.
-
Your Library Management Application (simplified version) must store
its data in a file at shutdown and read the information at start-up. Do
not forget to ask the user whether or not s/he wants to save the data before
your application does so (i.e., saves the data).
-
For Java programmers: You must name your Library Management Application
class (the class with the main method) LMA.java. The reason
for this is that it will be easier for the marker to execute your application.
S/he will simply need to type this command in order to execute your Library
Management Application:
java LMA
General Requirements *** very important ***
Before attempting this assignment, please, read the General
Requirements and Marking Scheme for Assignments. This document lists
some general requirements which your solution to this assignment must satisfy.
About Exception Handling
To learn about Java (and C++) exception handling mechanism, you may read
this document.
Getting Started
The first thing you will need to do is ensure that the problem statement
and the requirements stated in this assignment are clear to you. Feel free
to drop by the instructor's office hours with your questions. Once the
problem statement and the requirements stated in this assignment are clear,
you can proceed to Phase 1 - Design.
Submission
Assignment #1 is due Monday, January 29, 2007 @
23:59:59. You must electronically deliver
this assignment via the Submission program. More specifically, you must
submit:
-
Your completed UML design diagram from Phase 1 in a ".html"
document called DesignDiagram.html. This diagram
must contain completed "boxes" with class name, class characteristics as
well as class operations. You must also represent all the relationships
you have found between your objects (classes) using UML notation, as seen
in class.
-
The algorithm of all your methods of your LMA in a document called Algorithm.html
-
All your source files (Java or C++ code) properly named. Only submit your
*.java files (for Java) OR h.* and *.cpp files (for C++). Do not submit
your *.class files (for Java) OR your executable file (for C++). Do not
create Java packages nor Jar files, instead, put all your source files
in one directory, namely the src directory (see below).
When zipping your Assignment #1 directory into a zip file, make sure you
have the following directory structure:
-
your top directory must be called assn1
-
it must contain a completed copy of the file cover_page.html
or cover_page.txt
-
it must also contain the following two subdirectories:
-
src -> which must contain all your code
-
doc -> which must contain your DesignDiagram.html,
Algorithm.html
Note that in this assignment you do not have to submit your test plans
and test drivers. You are, however, strongly advised to practice creating
such documents. You can present them to your TA's and instructor for feedback.
Anne Lavergne - Last revision date: August
2006