Book Bank

Ads
 

Book Bank

Dear Sir, Could you send me the java codings for BOOK BANK.Its very urgent, please

View Answers

December 18, 2010 at 3:00 PM

Hi Friend,

Try the following code:

import java.io.*;
import java.util.*;

 public class BookBank{
    public static void main(String[]args)throws Exception{
        File f=new File("C:/books.txt");
        BufferedWriter bw=new BufferedWriter(new FileWriter(f,true));
        Book b=new Book();
        Scanner input=new Scanner(System.in);
        System.out.println("Book ID: ");
        String id=input.nextLine();
        System.out.println("Title: ");
        String  title=input.nextLine();
        System.out.println("Author: ");
        String  author=input.nextLine();
        System.out.println("Price: ");
        double  price=input.nextDouble();
        bw.write(id+" "+title+" "+author+" "+Double.toString(price));
        bw.newLine();
        bw.close();
        BufferedReader br=new BufferedReader(new FileReader(f));
        String line="";
        ArrayList list = new ArrayList();
           while((line = br.readLine()) != null){
           list.add(line);
           }
           Iterator itr;
           for (itr = list.iterator(); itr.hasNext();) {
           String str = itr.next().toString();
           String[] splitSt = str.split(" ");
           String ide = "", tit = "",aut="",p="";
           for (int i = 0; i < splitSt.length; i++) {
           ide = splitSt[0];
           tit = splitSt[1];
           aut = splitSt[2];
           p = splitSt[3];
           }
           System.out.println(ide+"    "+tit+"     "+aut+"    "+p);
           }
    }   
}

Hope that it will be helpful for you.

Thanks

Ads









Related Tutorials/Questions & Answers:
Book Bank
Book Bank  Dear Sir, Could you send me the java codings for BOOK BANK.Its very urgent, please   Hi Friend, Try the following code...)); Book b=new Book(); Scanner input=new Scanner(System.in
Mini project on Book Bank using netbeans tool with java and for database using mysql
Mini project on Book Bank using netbeans tool with java and for database using mysql  hi roseindia, i have need the miniproject on bookbank with the deisgn using the netbeans tool, and create the database for that using mysql
Advertisements
Mini project on Book Bank using netbeans tool with java and for database using mysql
Mini project on Book Bank using netbeans tool with java and for database using mysql  hi roseindia, i have need the miniproject on bookbank with the deisgn using the netbeans tool, and create the database for that using mysql
refrence book
refrence book  suggest many good book for hibernet
book system
book system  i have a problem here..how can i make a system for borrowing books, which include members or non members category, books category, rent category, return category and buy category
note book program
note book program  note reference program
ModuleNotFoundError: No module named 'book'
ModuleNotFoundError: No module named 'book'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'book' How to remove the ModuleNotFoundError: No module named 'book' error
E BOOK REQUIRED
E BOOK REQUIRED  Wicket in Action pdf required Urgently. Thnx
j2ee text book
j2ee text book  what is the best book for learning j2ee with examples in weblogic server with (netbeans or eclipse
online address book
online address book  how to create online address book using jsp and mysql
bank application
bank application  hello sir I got the simple bank application project which is very useful but I want the database for this project kindly send me database for this simple online bank application
miniproject on address book in java
miniproject on address book in java  hi rose india, i urgently need an miniproject on address book in java(netbeans ide 6.9.1) using mysql..... Though not of address book but operations are same i.e add,delete,search,update
ModuleNotFoundError: No module named 'cubicweb-book'
ModuleNotFoundError: No module named 'cubicweb-book'  Hi, My... 'cubicweb-book' How to remove the ModuleNotFoundError: No module named 'cubicweb-book' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-book'
ModuleNotFoundError: No module named 'django-book'  Hi, My Python... 'django-book' How to remove the ModuleNotFoundError: No module named 'django-book' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'jupyter-book'
ModuleNotFoundError: No module named 'jupyter-book'  Hi, My Python... 'jupyter-book' How to remove the ModuleNotFoundError: No module named 'jupyter-book' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'jupyter-book'
ModuleNotFoundError: No module named 'jupyter-book'  Hi, My Python... 'jupyter-book' How to remove the ModuleNotFoundError: No module named 'jupyter-book' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'lino-book'
ModuleNotFoundError: No module named 'lino-book'  Hi, My Python... 'lino-book' How to remove the ModuleNotFoundError: No module named 'lino-book' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'lino-book'
ModuleNotFoundError: No module named 'lino-book'  Hi, My Python... 'lino-book' How to remove the ModuleNotFoundError: No module named 'lino-book' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'prob-book'
ModuleNotFoundError: No module named 'prob-book'  Hi, My Python... 'prob-book' How to remove the ModuleNotFoundError: No module named 'prob-book' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'sphinxcontrib-book'
ModuleNotFoundError: No module named 'sphinxcontrib-book'  Hi, My... named 'sphinxcontrib-book' How to remove the ModuleNotFoundError: No module named 'sphinxcontrib-book' error? Thanks   Hi, In your
Book Writing
Book Writing Book Writing... story told? We know that writing a book is not everyone's cup of tea... partner to give a professional support for your book writing
Bank
Bank
Bank
Bank
Bank
Bank
validate bank account number
validate bank account number  how to validate bank account number in jsp
validate bank account number
validate bank account number  how to validate bank account number in jsp
Bank Management System
Bank Management System  I need a Bank Management System Project in Java Swing
Bank project
Bank project   Create a class Customer a. Having Instance variables Customer id(int), Customer Name(String), Customer Address(String), Customer Telephone(String) and Customer Email id(String) b. Method which generates Customer Id

Ads