Share on Google+Share on Google+

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

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

Ads

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
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
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
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
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
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
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
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
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
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
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
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
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads