Question
Asked by:
missprince
missprince
Rating : No Rating
Questions Asked: 6
Tutorials Posted: 0
 

$5.00 Need more than a Main

Q:

I've already got the program  and it runs but my teacher wants more than one file...preferrably a main and a logic file separate for whatever reason.

Develop an application that reads product id, product name and product price from an input text file.

Example input product text file should be in the format:

1001 Rake 20.00
1002 Hose 15.00
1003 Lawnmower 200.00
1004 Drill 150.00

Product id should be the first field, one word product description should be the second field, and the price in dollars and cents (no commas) should be the third field. White spaces (no commas) should be used as the delimiter between each field and a platform independent line separator should be used at the end of each product record. Your file may be used as input to a future application which is why the format is important.

If the price of the item is greater than or equal to 50.00 write the product information to a text file called WishList.txt. If the price of the item is less than 50.00 write the product information to a text file called GiftIdeas.txt.

If your output file(s) already exist, you should append to the file and not overwrite it. Your output text files should be in the same format as the input product text file. Product id should be the first field, one word product description should be the second field, and the price in dollars and cents (no commas) should be the third field. White spaces (no commas) should be used as the delimiter between each field and a platform independent line separator should be used at the end of each product record. Your output files may be used as input to a future application which is why the format is important.

 
Attachments:
ProductSortZipped.zip (61K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
rannok_026
rannok_026
Rating (199): A-
Questions Asked: 5
Tutorials Posted: 1449, earned $4,800.36
 

$5.00 INVENTORY FILE

  • This tutorial hasn't been purchased yet.
  • Posted on Oct. 17, 2009 at 01:00:22AM
A:
Preview: ... hment... ...

The full tutorial is about 5 words long plus attachments.

Attachments:
InventoryFiles3.zip (13K) 

 InventoryFiles3/build.xml
 InventoryFiles3/build/classes/.netbeans_automatic_build
 InventoryFiles3/build/classes/inventoryfiles3/InventoryWriteToFiles.class
 InventoryFiles3/manifest.mf
 InventoryFiles3/nbproject/build-impl.xml
 InventoryFiles3/nbproject/genfiles.properties
 InventoryFiles3/nbproject/private/private.properties
 InventoryFiles3/nbproject/private/private.xml
 InventoryFiles3/nbproject/project.properties
 InventoryFiles3/nbproject/project.xml
 InventoryFiles3/products.txt
 InventoryFiles3/src/inventoryfiles3/InventoryWriteToFiles.java
 ]

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

$5.00 Java: 3 classes, Scanner input, sort, PrintWriter output(appending), NetBeans folder, UseNotes

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Oct 17, 2009 at 9:52:09PM
A:
Preview: ... getName() {         return new String(this.name);     }     public double getPrice() {         return this.price;     }     // set or mutator methods:     public void setId(int idIn) {         this.id = idIn;     }     public void setName(String nameIn) {         this.name = nameIn;     }     public void setPrice(double priceIn) {         this.price = pri ...

The full tutorial is about 218 words long plus attachments.

Attachments:
ProductSortDriver.java (0K) (Preview)
Product.java (0K) (Preview)
ProductSortApplicationUseNotes.txt (4K) (Preview)
ProductSortApplicationZipped.zip (29K) 

 ProductSortApplicationZipped/ProductSortApplication/build.xml
 ProductSortApplicationZipped/ProductSortApplication/build/classes/Product.class
 ProductSortApplicationZipped/ProductSortApplication/build/classes/ProductSortApplicationUseNotes.txt
 ProductSortApplicationZipped/ProductSortApplication/build/classes/ProductSortDriver.class
 ProductSortApplicationZipped/ProductSortApplication/build/classes/ProductSortLogic.class
 ProductSortApplicationZipped/ProductSortApplication/dist/ProductSort.jar
 ProductSortApplicationZipped/ProductSortApplication/dist/README.TXT
 ProductSortApplicationZipped/ProductSortApplication/manifest.mf
 ProductSortApplicationZipped/ProductSortApplication/nbproject/build-impl.xml
 ProductSortApplicationZipped/ProductSortApplication/nbproject/genfiles.properties
 ProductSortApplicationZipped/ProductSortApplication/nbproject/private/config.properties
 ProductSortApplicationZipped/ProductSortApplication/nbproject/private/private.properties
 ProductSortApplicationZipped/ProductSortApplication/nbproject/private/private.xml
 ProductSortApplicationZipped/ProductSortApplication/nbproject/project.properties
 ProductSortApplicationZipped/ProductSortApplication/nbproject/project.xml
 ProductSortApplicationZipped/ProductSortApplication/ProductData.txt
 ProductSortApplicationZipped/ProductSortApplication/src/Product.java
 ProductSortApplicationZipped/ProductSortApplication/src/ProductSortDriver.java
 ProductSortApplicationZipped/ProductSortApplication/src/ProductSortLogic.java
 ProductSortApplicationZipped/ProductSortApplicationUseNotes.txt
 ]

   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty