Jim Lynch
Software Engineering CSC 481
Individual Semester Project
7.1. // Source file: scanners.java
7.1. // Source file: keyboard.java
7.2. // Source file: system.java
The purpose of the project is to design a video store terminal with scanners. It must be simple to use, minimizes errors, fast, and efficient.
Corner Video Store is my customer. It caters to local residents within walking distance of the store.
It will provide two activities, renting and returning videos.
The system will use scanners for videos and customer ID cards, and a keyboard for other clerk input.
It will update and display customer account information.
It will update video usage.
The terminal shall be efficient and easy to use.
The system must track late fees and update the customer s account.
A customer may only rent two videos at a time.
The system must conform to all applicable Federal, State and local regulations.
scanners catch_c_id() catch_v_id()
keyboard rent_kbrd() payment()
return_kbrd()
system get_c_id() get_v_id()
rent_sys() displayAccount() commit()
return_sys() printReceipt() displayReadyState()
database RENT_DB() RETURN_DB()
UPDATE()
customer c_id name
creditCard cardExpDate charges
rental1 rental1ReturnDate rental2
rental2ReturnDate
video v_id title
stars releaseDate cost
renter
scanners c_id v_id
The functions and attributes above can be implemented within the given cost and schedule constraints. One problem with the current store system is that it doesn t have scanners. All data must be entered from the keyboard. This is slow and error prone. A quick and efficient system will make the store more user friendly.
A customer comes into the store to either rent or return a video.
When a customer rents a video, the clerk scans their store ID card and the video. The transaction and current charges are then displayed (including late fees). After payment is received, account and the video records are updated.
When a video is returned the clerk scans the video, the records are updated (including late fees if applicable), and the video is restocked.
Actors: Clerk
Purpose: To make a rental association between the customer account and the video.
Overview: The clerk scans the customer ID and the video. The system associates that video with the customer account. Then it determines the current charges and displays this on the monitor. The clerk collects the money, the system prints a receipt, and the records are updated
Actor Action |
System Response |
1. Clerk scans video. |
2. Gets video data. |
3. Clerk scans customer ID. |
4. Gets customer account, including current late fees. |
|
5. Displays customer account with this transaction. |
6. Completes transaction. |
7. Updates records. |
Actors: Clerk
Purpose: To update customer account and video data.
Overview: The clerk scans the video. The system gets and updates the customer account and the video usage. Applicable late fees are added to the account.
Actor Action |
System Response |
1. Clerk scans video. |
2. Gets video data and customer account. |
|
3. Updates account and video records. |
public interface scanners
{ /** The value of the video ID. */
private long v_id = null;
/** The value on the customer ID card. */
private long c_id = null;
/** Scanner gets customer id from ID card.
@roseuid 3CA182D50023 */
public void catch_c_id(long c_id);
/** Scanner gets video id.
@roseuid 3CA18F9501F3 */
public void catch_v_id(long v_id);
} // END INTERFACE SCANNERS
public interface keyboard
{ /** A keyboard button that tells the system to get the
customer and video ID's from the scanner and rent
the customer this video.
@roseuid 3CA2124F035C */
public void rent_kbrd();
/** @roseuid 3CA188DE03D2 */
public float payment(float money);
/** A keyboard button that tells the system to
get the video ID from scanner and update
the records of a returned video.
@roseuid 3CA21279001D */
public void return_kbrd();
} // END INTERFACE KEYBOARD
public final class system
{ static
{
}
{
}
system()
{
} // end system
protected void finalize() throws Throwable
{ super.finalize();
} // end finalize
/** Get c_id from scanners and set the scanner
value to null. @roseuid 3CA266210389 */
public long get_c_id() {
} // end get_c_id
/** Get v_id from scanners and set the scanner
value to null. @roseuid 3CA2665502F8 */
public v_id get_v_id()
{
} // end get_v_id
/** Use get_c_id and get_v_id to get c_id and v_id
from scanner. Use these to call database and add
this video to the customers account. Also, set the
video usage to this customer.
@roseuid 3CA191EA026A */
public customer rent_sys(long c_id, long v_id)
{
} // end rent_sys
/** Tell the database to update and commit the
transaction. @roseuid 3CA192FD0265 */
public void commit(float money, long c_id, long v_id)
{
} // end rent_sys
/** Use get_v_id from the scanners, call the database
to get customer ID from video usage. Check for
late fees, remove video from customer account,
set video usage to null, and commit.
@roseuid 3CA197BC010E */
public void return_sys(long v_id)
{
} // end return_sys
/** Display ready/wait state on monitor.
@roseuid 3CA194FB0182 */
public void displayReadyState()
{
} // end displayReadyState
/** Display account with this transaction on
monitor. @roseuid 3CA1929C0003 */
public void displayAccount(CUSTOMER customer)
{
} // end displayAccount
/** Print receipt on terminal printer.
@roseuid 3CA194710007 */
public void printReceipt(CUSTOMER customer)
{
} // end printReceipt
} // END CLASS SYSTEM