$5.00 Need more than a Main
- From Computer-Science: Object-Oriented-Programming , Computer-Science: Object-Oriented-Programming
- Closed, but you can still post tutorials
- Due on Oct. 20, 2009
- Asked on Oct. 17, 2009 at 12:47:14AM
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.00Product 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)



