Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Implement a program to:

- use a GUI interface to control and display the results of the program,
- read a text data file,
- instantiate appropriate classes,
- create an appropriate internal (multi-tree) data structure,
- display the structure in a convincing way using a JTextArea, and
- search the structure.

Elaboration:

The scenario is inspired by a Library Management System (LIMS). For the first version of the project, the LIMS is a very basic one, allowing just for the import of data from a text file and perfom some basic search operations.

The elements of the LIMS are: the Library itself (let's consider just one instance for now) that contains a collection of Authors. Each Author
includes a collection of Books he/she published.

Eventually (in the next versions of the project), there will be clients that will concurrently access the LIMS in order to borrow/return book
copies.

The Author and Book classes will have some attributes, mainly used for searching and sorting.

1. Required data structure - the data structure I want you to implement is a multi-tree with the following levels:

1. Library - Level 0
2. Author - Level 1
3. Book - Level 2

2. Use at least the following classes, you are free to define others in the spirit of this application.

Specifications for a few classes - you are free to add to this list.

- Library
- ArrayList as an instance variable data structure
- Author - index, a name, an address and list of a number of Books (accessed by links to instances of the Book class).
- ArrayList as an instance variable data structure
- Book - index, a title, a genre, author by index
3. Use the ArrayList class to hold instances of the classes defined in item 1. Be sure to use generics appropriately.
4. Use a text data file with the following format - which you may extend, and may be extended in the later projects. As a minimum, each item should be specified by a single line in the data file. The initial fields should be used during the instantiation of objects and your program should ignore later fields that are not used. For simplicity, let us assume that the fields are separated by colons. The specifications look something like the following, where the angle brackets are not part of the actual data file. I think we can assume that name, address, title and genre are strings.

- b:::::
- a:::
Your program should
- work if there are additional fields on some lines,
- ignore blank lines,
- ignore lines starting with a / (as comments),
- accept spaces within names and types, and
- ignore extra spaces around the :'s nicely.

1. All the classes should be provided with appropriate:
- constructors
- toString implementations
- additional methods
- instance variables connecting the class to appropriate instances of other classes

1. A GUI that will allow the user to do at least the following operations:
- Select the data file at run time, using JFileChooser starting at dot.
- Show the internal data structures in a text area
- Search for an item by index, title or genre. For example, the book whose title is "Java Basics".
- Resize nicely in a JFrame.

1. The GUI class(es) should be distinct from the other classes in the program. Hmm - this is the statement in the common syllabus, but I am not so sure this is always a good idea, nor exactly how appropriate this requirement is for this project. This is an interesting topic to explore in the Weekly Conference.

Deliverables

1. Java source code files
2. any configuration files used including your data file
3. a well-written document including the following sections:

1. Design: including a UML class diagram showing the type of the class relationships

2. User's Guide: description of how to set up and run your application

3. Test Plan: sample input and *expected* results, and including test data and results, with screen snapshots of some of your test cases

4. (optionally) Comments: design strengths and limitations, and suggestions for future improvement and alternative approaches

5. Lessons Learned

6. Use one of the following formats: MS Word doc, docx, OpenOffice odf, pdf, rtf.

Format

(The following is from the standard syllabus, but I really don't care about any of these details. Your document should be easy to read and convey the information about your project in a reasonable manner. If you wish to follow a style, I would suggest IEEE or ACM style rather than APA.)

Documentation format and length. The documentation describing and reflecting on your design and approach should be written using  Microsoft Word, and should be no more than five pages in length and no less than two pages. The font size should be 12 point. The page margins should be one inch. The paragraphs should be double spaced. All figures, tables, equations, and references should be properly labeled and formatted using APA style.

- Code format:
- header comment block, including the following information in each source code file:
- file name
- date
- author
- purpose
- appropriate comments within the code
- appropriate variable and function names
- correct indentation
Sample data file:
// sample data file for CMSC 335, Spring 2014
// Mihaela Dinsoreanu
// Jan 5, 2014
// Books format:
// b:::::
b : 10001 : Java Basics : Science : 11.50 : 20001
b : 10002 : Advanced Java : Science : 10.99 : 20001
// Authors format:
// a:::
a : 20001 : John Smith : Computers St. 50 Seattle
a : 20002 : Mary Jones : Literature Lane 25
------------------------------
Some more thoughts you might want to consider:

Generally, the project should be what call "in the Java spirit" - by which I mean defining and using classes, variables and methods appropriately.

Some examples:

1. You should ask yourself if it makes sense to instantiate a class more than once. This has implications for which variables should be local to a method, which methods should be instance vs class (static) and which variables should be instance vs class.

2. For example, if you are going to use a class like a Library class to contain everything, it makes sense to have more than one library, and
each library could have its own data file.

3. In a Library, some students have pointed out the there might be other types of publications besides Books. How should we handle these?

I suggest a single data structure to handle the lot - an ArrayList is most appropriate, but that structure is generic, so what kind of generic declaration should we use, perhaps ArrayList , but that seems like a too general structure since we don't really want stuff like JLabel or JButton this structure. Thus, we are lead to proposing another class, say LibraryElement, and the Book class should extend this class, and then we can use the following declaration: ArrayList to hold stuff that is just lying around.

Java, Programming

  • Category:- Java
  • Reference No.:- M9905108
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As