Question
Asked by:
nicholsbradley
nicholsbradley
Rating : No Rating
Questions Asked: 21
Tutorials Posted: 0
 

$15.00 Help Please 2

Q:
Develop an application that reads the products.txt file created in Phase 1 DB and prints the contents of the file to the screen. This application should not recreate the products.txt file to start with. It is assumed the products.txt file has already been created. Your application should be written with flexibility in mind. This means that no absolute pathnames to the location of the products.txt file should be hardcoded in your application. Your application can let the user enter the pathname of the location of the products.txt file or assume the products.txt file will be found in the current working directory (in your NetBeans project folder). The output to the screen should be in the following format:

1001 Rake 20.00
1002 Hose 15.00
1003 Lawnmower 200.00

Each product's information should be on a separate line. Product id should be first, followed by the one word product description, followed by the price in dollars and cents. White space should be used as delimiter (no commas).

When you submit your zipped NetBeans project folder, be sure you include the products.txt file you used to test your application.

Before you write any Java code, start with planning comments also known as pseudocode. These comments will serve as the outline of your logic for each method including your test application. The comments should be left in your code and part of your grade will come from these comments.

 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
 

$15.00 Java inventary part2: Complete application

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jul 05, 2009 at 4:17:13PM
A:
Preview: ... Please ...

The full tutorial is about 5 words long plus attachments.

Attachments:
invenpart2.zip (2K)
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$15.00 Java, Part2, NetBeans project folder, read file w/ Scanner, UseNotes, ScreenShot,

  • This tutorial was purchased 4 times and rated A+ by students like you.
  • Posted on Jul. 06, 2009 at 12:26:14AM
A:
Preview: ... exception will be thrown when end of file is reached:<br> try {<br> line = inStream.nextLine();<br><br> parts = line.split(" ");<br> id = Integer.parseInt(parts[0]);<br> name = parts[1];<br> price = Double.parseDouble(parts[2]);<br><br> // display the data:<br> System.out.println(id + " " + name + " " + price);<br> } catch (Exception e) {<br> System.out.p ...

The full tutorial is about 985 words long plus attachments.

Attachments:
Part2.java (2K) (Preview)
Part2UseNotes.txt (2K) (Preview)
Part2UseNote.JPG (52K) (Preview)
NBpart2zipped.zip (63K)
Posted by:
tayunyang
tayunyang
Rating (5): A-
Questions Asked: 0
Tutorials Posted: 60, earned $93.92
 

$15.00 Java read file app

  • This tutorial hasn't been purchased yet.
  • Posted on Jul 06, 2009 at 4:44:11PM
A:
Preview: ... nputStreamReader(System.in);<br> br = new BufferedReader(isr);<br><br> try<br> {<br> filename = br.readLine();<br> }<br> catch (IOException e)<br> {<br> System.err.println("Cannot read filename. Error: " + e.getMessage());<br> System.exit(-1);<br> }<br><br> try<br> {<br> // Open the file that is the first command li ...

The full tutorial is about 226 words long plus attachments.

Attachments:
JavaReadFile.zip (12K)
Posted by:
 

$13.00 Java Application in NetBeans - With Products.txt and Sample output screen - Fully commented

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jul 07, 2009 at 08:37:12PM
A:
Preview: ... h Products.txt and Sample output ...

The full tutorial is about 31 words long plus attachments.

Attachments:
Products_screen.jpg (174K) (Preview)
Products_2.zip (144K)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty