$15.00 Java: BookInventory, Scanner input, ArrayList<Book>, NetBeans folder, UseNotes, consoleOutput
- This tutorial was purchased 6 times and rated A+ by students like you.
- Posted on Aug 04, 2009 at 11:38:38PM
A:
Preview: ... <br> }<br><br> String getPublisher() {<br> return new String(this.publisher);<br> }<br><br> double getPrice() {<br> return this.price;<br> }<br><br> // set methods:<br> void setTitle(String titleIn) {<br> this.title = titleIn;<br> }<br><br> void setAuthorFirstName(String authorFirstNameIn) {<br> this.authorFirstName = authorFirstNameIn;<br> }<br><br> void setAuthorLastName(String authorLastNameIn) {<br> this.authorLastName = authorLastNameIn;<br> }<br><br> void setISBN(String ISBNin) {<br> this.ISBN = ISBNin;<br> }<br><br> void setPublisher(String publisherIn) {<br> this.publisher = publisherIn;<br> }<br><br> void setPrice(double priceIn) {<br> this.price = priceIn;<br> }<br><br> public static void readInventoryFile() {<br><br> // open file:<br> Scanner inStream;<br> try {<br> // input file:<br> inStream =<br> new Scanner(new File(inFileName));<br><br> // read in book data:<br> while (inStream.hasNext()) {<br><br> Book yep = new Book(<br> inStream.nextLine().trim(), // title<br> inStream.nextLine().trim(), // fisst name<br> inStream.nextLine().trim(), // last name<br> inStream.nextLine().trim(), // publisher<br> inStream.nextLine().trim(), // ISMB<br> Double.parseDouble(inStream.nextLine().trim())); // price<br><br> // this displays each book as it's being read in:<br>// System.out.println(yep.toString());<br><br> bookList.add(yep);<br><br> // tead the empty line separating books in the file:<br> // this black line must follow each block of book into<br> // there must NOT be an empty line at the top of the file!<br> ...
The full tutorial is about 3044 words long plus attachments.
Attachments:
BookInventoryPrnScr.JPG (44K) (Preview)
BookInventoryConsole.txt (2K) (Preview)
BookInventoryUseNotes.txt (9K) (Preview)
BookInventoryZipped.zip (40K)
$10.00 Java code with constructors, array list, DataInputStream and all specified constraints
- This tutorial hasn't been purchased yet.
- Posted on Aug 07, 2009 at 09:32:35PM
A:
Preview: ... int("\\n Price: "+price);<br> } <br> }<br> <br> class bookInfo<br> {<br> public static void main (String[] args)throws IOException <br> {<br> String fname,lname,code,pub,tit;<br> float price;<br> <br> book[] b1=new book[20]; // object to receive values from user<br> book[] b2=new book[20]; // object to display values from array list<br> <br> int bookno,booksize,bookindex; // booksize total no. of books stored<br> // bookno used for index<br> // bookindex used to get index to search for a book<br> <br> String ch; // gets decision from user to continue<br> <br> ArrayList<book> booklst=new ArrayList<book>(); // stores book information<br> <br> DataInputStream in=new DataInputStream(System.in);<br> <br> booksize=0; // in ...
The full tutorial is about 340 words long plus attachments.
Attachments:
bookInfo.java (3K) (Preview)
RESULT.JPG (31K) (Preview)
$7.00 Simplified single source file only...for kipkemboi...
- This tutorial was purchased 1 time and rated A+ by students like you.
- Posted on Aug. 08, 2009 at 12:52:34AM
A:
Preview: ... "Invalid choice, please try again.");<br> } else {<br> return choice;<br> }<br><br> } catch (Exception e) {<br><br> System.out.println(<br> "Input error: " + e.toString());<br> }<br> }<br> }<br><br> public static void readInventoryFile() {<br><br> // open file and input data:<br> Scanner inStream;<br> // input file:<br> try {<br> inStream =<br> new Scanner(new File(inFileName));<br><br> // read in book data:<br> while (inStream.hasNext()) {<br><br> Book2 yep = new Book2(<br> inStream.nextLine().trim(), // title<br> inStream.nextLine().trim(), // fisst name<br> inStream.nextLine().trim(), // last name<br> inStream.nextLine().trim(), // publisher<br> inStream.nextLine().trim(), // ISMB<br> Double.parseDouble(inStream.nextLine().trim())); // price<br><br> bookList.add(yep);<br><br> // tead the empty line separating books in the file:<br> // this black line must follow each block of book into<br> / ...
The full tutorial is about 2275 words long plus attachments.
Attachments:
Book2.java (5K) (Preview)
BookFile.txt (0K) (Preview)
consoleOutput.JPG (101K) (Preview)
consoleOutput.txt (1K) (Preview)