Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this school project please: Cape Peninsula University of Technology Department of Information Technology Application Development Practice II October 2018 Project

Can someone help me with this school project please:

Cape Peninsula University of Technology

Department of Information Technology

Application Development Practice II October 2018

Project

You are asked to write an information management application for a small DVD rental store that is just starting up. The owners only have one copy of any particular Dvd.

Design a client/server system which maintains a database for the store.

The user requests database information and operations via the client application. The client app sends the database request to the server which executes the request and returns the results of the request back to the client.

Given:

The UMLs and Java source code for 3 classes, Dvd, Customer, and Rental.

Do not make any changes to the Dvd.java, Customer.java and Rental.java source code.

If you really have to make changes then you will have to re-create the ser files.

Dvd

-dvdNumber : int

-title : String

-category : String

-price : double

-newRelease : boolean

-availableForRent : boolean

<>+Dvd( )

<>+Dvd( dvdNumber : int, title : String , category : int, newRelease: boolean, avail : boolean )

+setdvdNumber(dvdNum : int) : void

+setTitle( aTitle : String ) : void

+setCategory( aCategory : int ) : void

+setRelease( rel : boolean ) : void

-setPrice( ) : void (NOTE: this method is private as it is only referenced from this class itself)

+setAvailable( avail : boolean ) : void

+getDvdNumber( ) : int

+getTitle( ) : String

+getCategory( ) : String

+getPrice( ) : int

+isNewRelease( ) : boolean

+isAvailable( ) : boolean

+toString( ) : String

Rental

-rentalNumber: int

-dateRented: String

-dateReturned: String

-customerNumber: int

-dvdNumber: int

-totalPenaltyCost : double

-TOTAL_PENALTY_COST_PER_DAY : final double

<>+Rental( )

<>+Rental(rentNumber: int, dateRented: String, custNumber: int, dvdNumber: int )

<>+Rental(rentNumber: int, dateRented: String, dateReturned: String, custNumber: int, dvdNumber: int )

+get methods..

+set methods..

+setDateReturned(String dt) : void (this method sets the date and also calls the method to determine the total penalty cost)

+numberOfDaysOverdue( ) : int

-daysBetween( date1 Date, date2 : Date) : int

-dateDifference(String dateRented, String dateReturned) : int

-determineTotalPenaltyCost( ) : void (this method calculates total penalty cost based on the number of days between

the date rented and the date returned.)

-toString( ) : String

Customer

-custNumber : int

-firstName : String

-surname : String

-phoneNum : String

-credit : double

-canRent : boolean

<>+Customer( )

<>+ Customer (custNumber : int, fName : String , sName : String , phone : String, credAmt: double, can : boolean)

+setCustNumber (custNumber int) : void

+setName( fName : String ) : void

+setSurname( sName : String ) : void

+setPhoneNum( phone : String ) : void

+setCredit( credAmt : double ) : void

+setCanRent(can : double ) : void

+getCustNumber( ) : int

+getFirstName( ) : String

+getSurname( ) : String

+getPhoneNum( ) : String

+getCredit( ) : double

+canRent( ) : boolean

+toString( ) : String

A serialized file containing customer data, Customers.ser

A serialized file containing movie data, Movies.ser

A serialized file containing rental data, Rentals.ser

Additional info:

Dvd class

Possible categories are horror, sci-fi, drama, romance, comedy, action, cartoon.

The fee for a movie is R10, and new releases are R5 more.

Customer class

When a customer is added to the system he/she must pay R100 which is captured as credit.

The rental fee is deducted from the customers credit when renting a movie.

If a customer has insufficient credit the option to pay the movie fee for this transaction is shown. The customer can choose to pay the required fee, or load R100 credit, or neither and thereby cancel the transaction.

Database Tables:

Customer table

custNumber is a primary key

A customer can only rent one Dvd at a time. A customer can only rent if a previously rented dvd has been returned. The attribute canRent indicates whether a customer is allowed to rent a dvd: When a customer rents a dvd this attribute is set to FALSE. When a customer returns a dvd, this attribute is set to TRUE.

Dvd table

dvdNumber is a primary key.

The attribute availableForRent is set to FALSE when a dvd is rented to a customer. It is set back to TRUE when a dvd is returned.

Rental table

rentalNumber is a primary key.

Attributes custNumber and dvdNumber are foreign keys.

totalPenaltyCost is calculated as follows: Every dvd rented must be returned within 24 hrs. R5 penalty is charged for every day exceeding the first 24hrs between the date rented and the date returned.

REQUIRED

Write a standalone JAVA program to load the data to the database. The program must:

Create database tables, customer, dvd and rental.

Load data into the database tables from the serialized files.

Display the number of rows inserted for each table.

Write a client server application to manage the car rentals.

CLIENT REQUIREMENTS

Write a GUI application which presents the user with options to manipulate the database. The minimum functionality of the client are:

Add a new customer

Add a new dvd

Rent a dvd

Select an existing customer

Select a movie category .Select from list of available movies for category selected

Display appropriate message after the server has updated the database

Return a dvd

Select/enter the rental number

Display appropriate message after the server has updated the DB tables. Display penalty cost if necessary.

List all movies and details by category (sorted)

List all customers and details (sorted alphabetically)

Search: the user enters a letter and all movies that start with that letter are listed.

.all movie lists must show the movie title, category, whether new release or not, whether available or not.

Include the following reports:

Display all rentals, sorted by date.

Display outstanding rentals (movies that have not been returned yet).

Daily rentals for a particular date.

Reduce chances of typing errors by making intelligent use of GUI items that require simple mouse-clicking to make selections.

SERVER REQUIREMENTS

Receive requests from the client to do transactions on the database. Results of these database requests are sent back to the client.

Add a new customer: execute the SQL command(s)

Add a new dvd: execute the SQL command(s)

Rent a dvd

Execute SQL to select all customers and send details to client

Execute SQL to select all dvds for a specific category and send details to client.

Receive the customer and dvd selected from the client.

Update the database tables

Update the customer table

Update the dvd table

Insert a new row (record) into the rental table.

Send a message to client indicating new rental is completed

Return a dvd

Receive the rental number from the client.

Update the customer table

Update the dvd table

Determine if dvd is overdue. Update the rental table.

Send a message to the client.

List all movies and details by category (sorted): Execute SQL to select dvd data and send to client

List all customers and details (sorted): Execute SQL to select all customer data and send to client

Reports: Execute SQL to select appropriate data and send to client

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago

Question

Design a training session to maximize learning. page 296

Answered: 1 week ago

Question

Design a cross-cultural preparation program. page 300

Answered: 1 week ago