FIT9131 Programming foundations in Java Assignment

Assignment Help JAVA Programming
Reference no: EM132671373

FIT9131 Programming foundations in Java - Monash University

Introduction

You must attribute the source of any part of your code which you have not written yourself. Your program will be checked with a code similarity detector. Please note the section on plagiarism in this document.

The assignment must be done using the BlueJ environment.

All user input to the system, and system output to the user, must be done at the BlueJ terminal window. No other graphical interfaces are to be used (nor assessed) in your program.

Specification

For this assignment you are required to write a program, My Library, that simulates a very small virtual library of electronic books. This section specifies the required functionality of this program.

Only a simple text interface (using the BlueJ Terminal Window) is required for this program; however, more marks will be gained for a game that is easy to follow with clear information/error messages to the player.

This program is functionally very different from the program you wrote in Assignment 1 and 2.

My Library should provide the following features:

• maintains a list (using a Java Collection class) of Borrower objects
o each Borrower object represents a person who can "borrow" books from the virtual library
o the list does not have a fixed size

• maintains a list (using a Java Collection class) of Book objects
o each Book represents a book which can be borrowed by a Borrower object
o each virtual book can be borrowed by different borrowers at the same time
o the list does not have a fixed size
o a book has a rating (General/Adult), which limits its availability to a borrower based on his age

• allows each borrower to borrow up to 2 books at any one time
• lists the details of an existing borrower and the books he/she has currently borrowed
• produces a report of all borrowers
• allows a borrower to borrow/return a book
• loads a list of borrowers from a text file

o a sample data file will be provided to you - your program must be able to read the data from this file, and write back to the same file

• loads a list of books from a text file

o a sample data file will be provided to you - your program must be able to read the data from this file

• saves the list of current borrowers (with the borrowed books) to a text file

You are to demonstrate the following programming techniques in your program:

• reading/writing data from/to text files
• using appropriate classes to represent the various objects in the program
• using appropriate Java Collection class or classes to store data
• using code to manipulate the data in the collection(s)
• performing simple searches, filtered by some given criteria
• using program constructs such as repetitions & selections

There will be a description of the Borrower and Book classes (and the collection classes which store them) later in this document.

You are also required to produce a partial Test Strategy for your program.

Program Logic
When the program starts, it should automatically load 2 text files:

• "borrowers.txt" which contains details of all borrowers currently stored in the system
• "books.txt" which contains details of all books currently available in the system
The actual format of these text files is described later in this document. The data loaded should be stored in some appropriate data structures. No other reading from (or writing to) file is required while the program is in operation, until the user chooses to exit, at which point the program saves all the in-memory borrowers' data back to the same text file (borrowers.txt) - the book data does not need to be saved as it is not modified by this program.

In other words, all the file I/O operations are performed automatically by the program, once at the start and once at the end, and require no interactions with the user.

When the program is running, it should repeatedly display a menu with these options,

Option (1) registers a new borrower. Information to be entered will be a name, an ID, and an age.

Option (2) manages an existing borrower. The borrower is to be searched for by some sensible criteria. A
second menu will allow the following operations for that borrower,

Note that a book's rating determines whether or not it can be borrowed by a particular borrower.
Option (3) lists all the current borrowers (& their borrowed books).

Option (4) displays some sensible help screen to explain how the program works.

Option (5) exits the program. All the borrowers' data currently in memory are automatically saved to "borrowers.txt". The memory is then cleared.
Inputs other than 1-5 (including non-numeric inputs) should be rejected, and an error message printed. The menu should be displayed repeatedly, until the user chooses Option (5).

Program Design
Your program must demonstrate your understanding of the object-oriented concepts and general programming constructs presented in FIT9131. Consider carefully your choice of classes, how they interact and the fields and methods of each class.

You must use appropriate data structures to store the various objects (list of borrowers, list of books, etc) in the program. If you do not understand what this means, ask your tutor now.

You must be able to justify the choice of the data structures during your interview. You must document any additional assumptions you made.

Appropriate validations of values for fields and local variables should also be implemented. You should not allow an object of a class to be initialized/set to an invalid state (ie. put some simple validations in your mutator methods).

Discuss with your tutor what classes are appropriate, and how they interact with each other. The main requirements are:

(1) the borrowers and books must be implemented as objects, and they must be stored in some appropriate Java collections (e.g. an ArrayList of Borrowers)

(2) the list of books within each borrower object must also be stored in some appropriate Java collections (e.g. an Array of 2 Books)

Your program must deal with invalid values entered by the user in a sensible manner. For instance, if a user enters "abc" when a number is expected, your program should not crash.
Exception handling should be used where appropriate.

All on-screen input/output should be formatted in a user-friendly manner. Sensible error messages should be displayed whenever appropriate (e.g. entering a duplicate borrower ID, entering a number outside the allowable valid range, etc).

Attachment:- Programming foundations in Java.rar

Reference no: EM132671373

Questions Cloud

Compute the approximate cost of new common stock : Expected cash dividents are $3.00, the dividend yield is 4%, flotation costs are 4% of price, and the growth rate is 3%.
Summarize the results of your ei quotient test : After completing the test, in at least two paragraphs answer the following: Summarize the results of your EI Quotient test. Explain how the skills identified.
Company pretax cost of debt-too young inc : The bond currently sells for $1,877 and matures in 19 years. The par value is $2,000. What is the company's pretax cost of debt?
Is anything unique about chris idea and why : Chris Wasserberg is a salesperson for a Fortune 100 firm. When this is done, what else should Chris do? Outline a general course of action of him
FIT9131 Programming foundations in Java Assignment : FIT9131 Programming foundations in Java Assignment Help and Solution, Monash University - Assessment Writing Service
Firm weighted average aftertax cost of debt-great lakes : Great Lakes Packing has two bond issues outstanding. The first issue has a coupon rate of 3.80 percent, a par value of $1,000 per bond, matures in 5 years
What might be the consequences of faking fans : Why do some businesses resort to such measures? What might be the consequences of faking fans? How do you feel about companies and their brands pretending
Discuss about the misunderstanding of customer requests : Detail the procedures you would expect staff to follow within your industry workplace in response to the various customer complaints listed below.
What is the real rate of return on bond : A bond that pays interest annually yields a rate of return of 8.50 percent. The inflation rate for the same period is 4 percent. What is the real rate of return

Reviews

Write a Review

JAVA Programming Questions & Answers

  How would i do a uml diagram

How would I do a UML diagram with the following requirements?

  Leadership position in a hospital emergency room

Identify in a leadership position in a hospital emergency room. Evaluate how  organization handles patient and employee education, and whether that organization participates in any research (if so, find out what types and whether it is mostly qualita..

  Implement simple java program to input syllabus grades

To implement simple Java program to input (hypothetical) syllabus grades, computing and displaying both normal Mean and Harmonic Mean.

  Improve the efficiency of their operations

To help improve the efficiency of their operations, the Maitre De has hired you to write a program that simulates people waiting for tables. The goal is to determine the average amount of time people spend waiting for tables.

  Write a program to test your class definition

Do not define an input method. The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition.

  Compare the total annual compensation

Compare the total annual compensation - The application will now compare the total annual compensation of at least two salespersons.

  Create application in java programming

Write method multiple that determines, for a pair of integers, whether the second integer is a multiple of the first.

  Calculate the greatest common divisor

Implement a recursive method to calculate the Greatest common Divisor. The gcd (Greatest common Divisor) of a and b is calculated as follows

  Implement the sieve of eratosthenes

Implement the Sieve of Eratosthenes and use it to find all prime numbers less than or equal to one million. Use the result to prove Goldbach's Conjecture

  You will need a bottomuptwothreefourtree class with a

you will need a bottomuptwothreefourtree class with a bottomuptwothreetreefourtree constructor which takes no

  Develop a graphical user interface

COSC1295 Advanced Programming - Develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment

  Prepare a method rearrange that takes a queue

Prepare a method rearrange that takes a queue of integers as a parameter and rearranges the order of the values so that all of the even values appear before the odd values and that otherwise preserves the original order of the list.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd