Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Baskar
Book Bank
1 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


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


Advertisement
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



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
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
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
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
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
validate bank account number
validate bank account number  how to validate bank account number in jsp
security mangement for bank's IT infrastructure
security mangement for bank's IT infrastructure  how i can give account number to a customer in our bank database??? plz help me out
bank management - Java Beginners
bank management  Assume that the bank maintains two kinds of accounts for its customers, one called savings account and the other current account... but no cheque book facility. The current Account provides cheque book facility
abt the bank application
abt the bank application  pls can u send to me the user table and transaction table sql statement with their datatype used in this bank application to my email
note book program
note book program  note reference program
E BOOK REQUIRED
E BOOK REQUIRED  Wicket in Action pdf required Urgently. Thnx
online address book
online address book  how to create online address book using jsp and mysql
j2ee text book
j2ee text book  what is the best book for learning j2ee with examples in weblogic server with (netbeans or eclipse
how to generate bank account number?
how to generate bank account number?  how to generate account number?or format or rules for bank account number
bank details - JSP-Servlet
bank details  hi i just need a coding for bank details... since iam working as a trainee my leader gave me task like this.. What he want me to do is first to set the user account details in database, and the to create a login
book for struts 1.2.9 - Struts
book for struts 1.2.9  Can any body suggest me book for struts 1.2.9 ? because using net beans 6.1 and they provided struts 1.2.9 support for net beans 6.1 please suggest me book for same and link if u have so i can download
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
Bank account manangement - Java Beginners
Bank account manangement  Assume that the bank maintains two kinds of accounts for its customers, one called savings account and the other current... but no cheque book facility. The current Account provides cheque book facility
Address book in iphone
Address book in iphone  hello.. how can we use address book in our iphone app ???   hello Nice Question first of all you have...{ return NO; } this is the whole process for implement address book in you
Bank account gui
Bank account gui  Add event handling to the AccountUI class which will allow you to: 1. Create new account, when the â??Createâ?? button... static void main(String arg[]){ Account at=new Account (); at.setTitle("Bank Account
bank account gui
bank account gui  Add event handling to the AccountUI class which will allow you to: 1.Create new account, when the ??Create?? button is pressed...[]){ Account at=new Account (); at.setTitle("Bank Account System"); at.setSize(500,300
 

 

 

DMCA.com