Question

In: Computer Science

NEED IN JAVA Problem statement. This application will support the operations of a technical library for...

NEED IN JAVA

Problem statement.

This application will support the operations of a technical library for an R&D organization. This includes the searching for and lending of technical library materials, including books, videos, and technical journals. Users will enter their company ids in order to use the system; and they will enter material ID numbers when checking out and returning items.  

Each borrower can be lent up to five items. Each type of library item can be lent for a different period of time (books 4 weeks, journals 2 weeks, videos 1 week). If returned after their due date, the library user's organization will be charged a fine, based on the type of item ( books $1/day, journals $3/day, videos $5/day).

Materials will be lent to employees with no overdue lendables, fewer than five articles out, and total fines less than $100.  

R & D Library 
books
UnderstandingMathematics 0015B
EngineeringAsAService 0012A
FundamentalAlgorithms 0008A
BigJava 0019C
SortingAndSearching 0071A
MathematicalComputations 0004B
journals
FeasibilityOfTheWeb X980
StudyOfAComet X324
ACaseStudyOfBehavioralActions X234
HowToKeepAJob X210
XgonGiveItToYa X821
videos
TedTalkSeries 12.W
LectureSeries 16.S
  1. You will write classes from the last in-class assignment, R&DLibrary. R&DLibrary is the main file in which a user can choose to enroll themselves, check out an item, return an item, pay a fine and display their account (what is currently checked out, accumulated fines).
  2. Write a material class that calculates the fine based off of the type of item, the length it’s been checked out and whether or not it’s even been checked out.
  3. Lastly, write a employee Class that contains the username of a user, the items that person has checked out, a copy of the accumulated fines and the number of items checked out.
  4. Create the program using repl.it online IDE and saving it to a files named, R&DLibrary.java, Employee.java, MaterialCard.java.
  5. Download all the files from repl.it.
  6. At the top of the empty file, write the following comment, modifying it to reflect your personal in- formation. Writing these comments on top of your programs helps other developers understand basic information about your programs and is a good habit to develop.
  7. /*

    * Program: LibraryReservation.java

    *

    * Author 1: FULL NAME

    *

    * Date:   THE CURRENT DATE

    * Course:  

    *

    * Program Description:

    *

    * WRITE PROGRAM DESCRIPTION

    *

    */

Solutions

Expert Solution

MaterialCard Class:

class MaterialCard{
    private String books[];
    private String journals[];
    private String videos[];
    private int totalFine;
    private int b;
    private int j;
    private int v;
    public MaterialCard(String books[],String journals[],String videos[]){
        this.books=books;
        this.journals=journals;
        this.videos=videos;
    }
    public String[] getBooks(){
        return books;
    }
     public String[] getJournals(){
        return journals;
    }
     public String[] getVideos(){
        return videos;
    }
    public void dueDates(int b,int j,int v){
        this.b=b;
        this.j=j;
        this.v=v;
    }
    public int getFine(){
        totalFine=books.length*b*1+journals.length*j*3+videos.length*v*5;
        return totalFine;
    }
}

Employee Class:

class Employee{
    private String userName;
    private int noOfItems;
     private int totalFine=0;
    public Employee(String userName,int noOfItems){
        this.userName=userName;
        this.noOfItems=noOfItems;
    }
    public String getUserName(){
        return userName;
    }
    public int getNoOfItems(){
        return noOfItems;
    }
    public void setEmplyoeeFine(){
        this.totalFine=totalFine;
    }
}

Main class: R&DLibrary

public class RDLibrary{
        public static void main(String[] args) {
            Scanner sc=new Scanner(System.in);
         System.out.println("Welcome to library");
         System.out.print("Enter your name:");
         String name=sc.nextLine();
         System.out.println("Enter number of items to lent(Should not be more than 5):");
         int n=sc.nextInt();
         Employee objE=new Employee(name,n);
         System.out.print("Enter number of books you want to lent:");
         int b=sc.nextInt();
         sc.nextLine();
         String book[]=new String[b];
         for (int i=0;i<b;i++ ){
             System.out.print("Enter Book "+(i+1)+" Name:");
             book[i]=sc.nextLine();
         } 
         System.out.print("Enter number of journals you want to lent:");
         int j=sc.nextInt();
          sc.nextLine();
         String journal[]=new String[j];
         for (int i=0;i<j;i++ ){
             System.out.print("Enter journal "+(i+1)+" Name:");
             journal[i]=sc.nextLine();
         } 
         System.out.print("Enter number of videos you want to lent:");
         int v=sc.nextInt();
          sc.nextLine();
         String videos[]=new String[v];
         for (int i=0;i<v;i++ ){
             System.out.print("Enter video "+(i+1)+" Name:");
             videos[i]=sc.nextLine();
         } 
         MaterialCard objM=new MaterialCard(book,journal,videos);
         System.out.println("You are checked in!");
         System.out.println("Now while checking out");
         System.out.print("Enter the no of days due for books: ");
         int b1=sc.nextInt();
         System.out.print("Enter the no of days due for journals: ");
         int j1=sc.nextInt();
         System.out.print("Enter the no of days due for videos: ");
         int v1=sc.nextInt();
          objM.dueDates(b1,j1,v1);
          System.out.println("Books you are returning: ");
          for (int i=0;i<objM.getBooks().length;i++){
              System.out.println(objM.getBooks()[i]);
          } 
          System.out.println("Journals you are returning: :");
          for (int i=0;i<objM.getJournals().length;i++){
              System.out.println(objM.getJournals()[i]);
          } 
          System.out.println("Videos you are returning");
          for (int i=0;i<objM.getVideos().length;i++){
              System.out.println(objM.getVideos()[i]);
          } 
          objE.setEmplyoeeFine(objM.getFine());
          System.out.println("Total fine is:"+objM.getFine());
          System.out.println(objE.getUserName()+"You are checked out Thank you visit again");
        }
}

Thank you! if you have any queries post it below in the comment section I will try my best to resolve your queries and I will add it to my answer if required. Please give upvote if you like it.


Related Solutions

Develop a Java application using Parboiled library to write aparser for a customer form. Your...
Develop a Java application using Parboiled library to write a parser for a customer form. Your program should include a grammar for the parser and display the parse tree with no errors.The customer form should include the following structure:First name, middle name (optional), last nameStreet address, city, state (or province), countryPhone numberRules• First name, middle name and last name should start with an uppercase letter followed by lower case letters. Middle name is an optional input meaning such an input...
It is required to develop an application in Java to perform some operations of a bank....
It is required to develop an application in Java to perform some operations of a bank. The application will have the following classes: Class called Person having following data fields (private): firstName (String), lastName(String), gender(char), cpr(long), mobile(String) and following methods: Constructor having 5 parameters to initialize all data fields, Set and get methods for all data fields, toString method to return String equivalent of all data fields, Abstract class called Account having following data fields(protected): accountHolder(Person), ccountNum(long), balance(double)and following methods:...
Java Programming I need an application that collects the user input numbers into an array and...
Java Programming I need an application that collects the user input numbers into an array and after that calls a method that sums all the elements of this array. and display the array elements and the total to the user. The user decides when to stop inputting the numbers. Thanks for your help!
Consider a library management system and create the problem statement for that. For domain modelling what...
Consider a library management system and create the problem statement for that. For domain modelling what are the domain classes that might be included in a model? What are some of the associations among these classes? What are some of the attributes of each class? Draw a domain model class diagram for this system
Create a library system Description: Library system is aimed to computerize the library management operations. Example,...
Create a library system Description: Library system is aimed to computerize the library management operations. Example, registring a student, issuing a book,Handling book returns,etc. Required skill set: OOP,Arrays Use File handling if necessary The language is visual studio c++
The problem of underemployment is not confined only to agriculture”. Support the statement with examples.
The problem of underemployment is not confined only to agriculture”. Support the statement with examples.
This is a Java program Problem Description Write an application that inputs five digits from the...
This is a Java program Problem Description Write an application that inputs five digits from the user, assembles the individual digits into a five-digit integer number (the first digit is for one’s place, the second digit is for the ten’s place, etc.) using arithmetic calculations and prints the number. Assume that the user enters enough digits. Sample Output Enter five digits: 1 2 3 4 5 The number is 54321 Problem-Solving Tips The input digits are integer, so you will...
I need a Java application with a GUI that includes the following requirements: Three classes minimum...
I need a Java application with a GUI that includes the following requirements: Three classes minimum At least one class must use inheritance At least one class must be abstract Utilization of “get set” method. (get; set; =  is related to how variables are passed between different classes. The get method is used to obtain or retrieve a particular variable value from a class. A set value is used to store the variables. The whole point of the get and set...
Problem 11-15 (Algorithmic) Ocala Software Systems operates a technical support center for its software customers. If...
Problem 11-15 (Algorithmic) Ocala Software Systems operates a technical support center for its software customers. If customers have installation or use problems with Ocala software products, they may telephone the technical support center and obtain free consultation. Currently, Ocala operates its support center with one consultant. If the consultant is busy when a new customer call arrives, the customer hears a recorded message stating that all consultants are currently busy with other customers. The customer is then asked to hold...
using java Define a class Library based on the following specifications: a. A library can have...
using java Define a class Library based on the following specifications: a. A library can have multiple books. Decide on the best possible data structure to store books. b. A library has a name. c. A library has an address. Define a 2-argument constructor for the Library class. Decide on the arguments needed for this constructor. e. Define a method that can add new books to the library. f. Define a method that allows a book to be borrowed (checked...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT