Question

the OOP project is needed to be coded in netbeans and store a information in file...

the OOP project is needed to be coded in netbeans and store a information in file on local machine it could be stored with xml tags since its easier.

OOP Project Description

Requirements:

You are to design and build software media rental system. The software will track each user’s account with its rentals. A user can rent multiple media of different type/genre and all that user’s rentals are managed under their account (single account per user). A user will be assigned a unique account id by the system and his first name, last name, and email address will also be stored at account creation. There will be ability to update the user’s name and email address but not the account id.

The software needs to be able to track different accounts, but the software should only load and actively manage one account at a time. There should be the ability to save account information to a file, re-open it later (one account per file using XML format), and delete the account (delete file with account information). The account id will be used as part of the filename to save, lookup to open, and delete account. There can be an account without any media rented.

There are 3 types of media that can be rented: Movie DVD, Music CD, and Audio Book CD. The company only rents certain genre of each media, shown in the table below. All media have following characteristics: media id (integer), title (String), year published (integer), file size in megabytes (double), rental end date (Calendar), and rental fee (Double). Audio book also has number of chapters (integer) and Music CD the length in minutes.

Media Type

Genre

Movie DVD

Romance

Drama

Documentary

Music CD

Country

Classical

Audio Book on CD

Memoir

SciFi

Romance

So for example, a user would rent a specific media such as a movie DVD of genre Romance with title “Love”, media id 100005, etc. Rental fee needs to be calculated at the time the rental is added to the account and the calculated fee should be stored in the rented media’s attribute.

Every media has a price to rent based on a 2 week rental. The following rules show how to determine the rental price.

Movie DVD rental has a flat fee of $3.50 for movie published within current year and otherwise a flat fee of $2.00. So for example if the DVD was published this year, it would cost $3.50 to rent for two weeks but if published last year, it would cost $2.00. However, Drama and Romance media has an additional fee of $0.25 added to the price so for documentary the above example would be $3.75 and $2.25 respectively.

Audio Book rentals are a little more complex.The rental price is calculated by multiplying the number of chapters * 0.10 and adding a $1 if the Audio Book was published this year. So if the Audio Book was published this year and the size is 20 chapters, the rental would cost $3.00 (20 * 0.10 + 1) and if it was published 2 years ago, it would be $2.00 to rent.

Music CDs are even more complicated because they depend of the type of music being rented. So classical rentals are calculated based on the file size * 0.015 and additional fee of 1.00 if published this year.Country music rental are calculated based on the file size * 0.02 and additional fee of 1.00 if published this year. So a classical music rental of size 114 MB published this year would cost $2.71 (114 *0.015 +1) and country music rental of 114 MB published this year would cost $2.28 (114 *0.02).

There also needs to be ability to add a media to the account, and delete media from the account. When a rental expires, it can be renewed for another two weeks.  

Here is a scenario how this system should work in a real business:

Imagine there are media boxes on the shelf in some rental place. So a customer comes in and gets some boxes of the rentals they want to get. They go up to the cashier and if it is their first time, an account will be created for them in the system. They will need to provide their first name, last name and email address that will be inputted by the cashier into the new account being created. The system will generate an account id for this user and cashier will give that information to the customer.

Then the cashier will scan each box for the media information, which will create the media object in the system. That object will be added to the account. The cashier will repeat for each media box to be rented. The rental end date will be set by the system, 2 weeks from the current date. The system will calculate the rental fee for each media being rented. All that information will be displayed on the screen: each media with its information and the rental fee for each (the actual displaying will be done by user interface which is not part of the system you are creating). Customer will pay and get receipt but that is outside of the scope of the system we are creating.

Then the customer may come in to return the media. He will provide his account number and the cashier will bring his account up. The cashier will select return choice in the user interface and scan each media to remove from his account. Let’s say he had 3 media rented but he is returning two of them. So those 2 rentals are removed from his account. For the one he still has he decides to renew it so cashier selects renew option in the user interface, scans the media and that media gets renewed for next two weeks. Again the fee is calculated and all the new information in the account is displayed by the user interface.

Then he notices on the screen that his name is spelled incorrectly or his email is not right. The cashier will be able to change that information in the account.

Next time when customer comes in, he may return the media he has but he may not want to rent at this time. His account will be still there but without any media until next time when he rents again.

The system you are designing will have the functionality needed to satisfy the above requirements as illustrated by the scenario. You will not be implementing the actual user interface (you will still design them though in assignment 7) but you need the classes, attributes, and methods to receive and provide the information that the user interface will need. You can assume that for a complete solution there would be some other class that implements user interface with main() method and the scanning module and that it will call your classes. You will write such a class with main() in assignment 8 as your test class.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

public class Library {
private ArrayList<Book> allBook = new ArrayList<Book>();

public Library(ArrayList<Book> other) {
if (other == null) {
throw new NullPointerException("null pointer");
} else
this.allBook = other;
}

public Library() {
this.allBook = new ArrayList<Book>();
}

public boolean add(Book book) {
if (book != null && !book.equals("")) {
throw new IllegalArgumentException("Can't be empty");
}
allBook.add(book);
return true;
}

public ArrayList<Book> findTitles(String title) {
for(Book b: allBook) {
if(title.compareTo(b.getTitle())== 0) {
return allBook;
}
}
return null;
}

public void sort() {
Collections.sort(allBook);
}

public String toString() {
return Library.this.toString();
}
}

public class Book implements Comparable<Book> {
private String bookTitle;
private ArrayList<String> bookAuthor;

public Book(String title, ArrayList<String> authors) {
if(title == null && authors == null) {
throw new IllegalArgumentException("Can't be null");
}
if(title.isEmpty() && authors.isEmpty()) {
throw new IllegalArgumentException("Can't be empty");
}
bookTitle = title;
bookAuthor = authors;
}

public String getTitle() {
return bookTitle;
}
public ArrayList<String> getAuthors( ) {
return bookAuthor;
}

public String toString( ) {
return bookTitle + bookAuthor;
}
public int compareTo(Book other){
return bookTitle.compareTo(other.bookTitle);
}
public boolean equals(Object o) {
if(!(o instanceof Book)) {
return false;
}
Book b = (Book) o;
return b.bookTitle.equals(bookTitle)
&& b.bookAuthor.equals(bookAuthor);
}
}

Add a comment
Know the answer?
Add Answer to:
the OOP project is needed to be coded in netbeans and store a information in file...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need a program in python. Asterix and Obelix want to store and process information about movies...

    Need a program in python. Asterix and Obelix want to store and process information about movies they are interested in. So, you have been commissioned to write a program in Python to automate this. Since they are not very computer literate, your program must be easy for them to use. They want to store the information in a comma separated text file. Using this they would need to generate a report – see all items AND show a bar chart...

  • You are a database consultant with Ace Software, Inc., and have been assigned to develop a...

    You are a database consultant with Ace Software, Inc., and have been assigned to develop a database for the Mom and Pop Johnson video store in town. Mom and Pop have been keeping their records of videos and DVDs purchased from distributors and rented to customers in stacks of invoices and piles of rental forms for years. They have finally decided to automate their record keeping with a relational database. You sit down with Mom and Pop to discuss their...

  • Information About This Project             In the realm of database processing, a flat file is a...

    Information About This Project             In the realm of database processing, a flat file is a text file that holds a table of records.             Here is the data file that is used in this project. The data is converted to comma    separated values ( CSV ) to allow easy reading into an array.                         Table: Consultants ID LName Fee Specialty 101 Roberts 3500 Media 102 Peters 2700 Accounting 103 Paul 1600 Media 104 Michael 2300 Web Design...

  • Java project: A Bank Transaction System For A Regional Bank User Story A regional rural bank...

    Java project: A Bank Transaction System For A Regional Bank User Story A regional rural bank CEO wants to modernize banking experience for his customers by providing a computer solution for them to post the bank transactions in their savings and checking accounts from the comfort of their home. He has a vision of a system, which begins by displaying the starting balances for checking and savings account for a customer. The application first prompts the user to enter the...

  • QUESTION: (Answer in SQL) Write an SQL query to find all pairs of users (A,B) such...

    QUESTION: (Answer in SQL) Write an SQL query to find all pairs of users (A,B) such that both A and B have blurted on a common topic but A is not following B. Your query should print the names of A and B in that order. BACKGROUND INFO: Users can post their thoughts in form of short messages that we call “blurts”. When signing up, users need to provide their email and a password of their choice. In addition, they...

  • Programming Project 3 See Dropbox for due date Project Outcomes: Develop a Java program that uses:...

    Programming Project 3 See Dropbox for due date Project Outcomes: Develop a Java program that uses: Exception handling File Processing(text) Regular Expressions Prep Readings: Absolute Java, chapters 1 - 9 and Regular Expression in Java Project Overview: Create a Java program that allows a user to pick a cell phone and cell phone package and shows the cost. Inthis program the design is left up to the programmer however good object oriented design is required.    Project Requirements Develop a text...

  • Read the case: Netflix Inc.: The Second Act - Moving into Streaming and complete your case...

    Read the case: Netflix Inc.: The Second Act - Moving into Streaming and complete your case analysis. Discuss the following: 1) briefly summarize the key marketing strategy issues in the case that are still relevant TODAY in addition to contemporary issues you find via research; 2) make thorough recommendations on how the issues should be handled; 3) provide a justification for the recommendations. Case write-ups should be 3-5 pages, double spaced, 12 font size in Times New Roman. The case...

  • It is August 2018. You are the manager on the audit of The Sophisticated Listener, Inc....

    It is August 2018. You are the manager on the audit of The Sophisticated Listener, Inc. (TSL) a company that until recently had operated a large retail store in Lindsay selling CDs and music accessories. George, the managing director and principal shareholder of TSI, has for some time held the view that the future of the retail trade lies in the potential offered by Internet shopping. Shortly after its year end, December 31, 2017, the company closed its retail store...

  • It is August 2018. You are the manager on the audit of The Sophisticated Listener, Inc....

    It is August 2018. You are the manager on the audit of The Sophisticated Listener, Inc. (TSL) a company that until recently had operated a large retail store in Lindsay selling CDs and music accessories. George, the managing director and principal shareholder of TSL, has for some time held the view that the future of the retail trade lies in the potential offered by Internet shopping. Shortly after its year end, December 31, 2017, the company closed its retail store...

  • Chapter 3 Information Systems, Organizations, and Strategy 103 INTERACTIVE SESSION: TECHNOLOGY IS...

    Chapter 3 Information Systems, Organizations, and Strategy 103 INTERACTIVE SESSION: TECHNOLOGY IS THE IPAD A DISRUPTIVE TECHNOLOGY? Tablet computers have come and gone several timesdistribution. Amazon has committed itself to offering before, but the iPad looks like it will be different It the lowest possible prices, but Apple has appealed has a gorgeous 10-inch color display, a persistent Wi publishers by announcing its intention to offer a Fi Internet connection, potential use of high-speed tiered pricing system, giving publishers the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT