Question
Asked by:
$10.00 Help Please
- From Computer-Science: Object-Oriented-Programming
- Closed, but you can still post tutorials
- Due on Jul. 08, 2009
- Asked on Jul 05, 2009 at 4:10:54PM
Q:Develop an application that reads product id, product name and product price entered from the user at the keyboard, and writes this information to a text file. Call the output text file products.txt.
The resulting output products.txt file should be of the format:
1001 Rake 20.00
1002 Hose 15.00
1003 Lawnmower 200.00
Product id should be the first field, a one word product description should be the second field, and the product price in dollars and cents (no $) 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.
The application should repeatedly prompt for this product information until terminated by the user. Do not use Ctrl-Z to terminate as NetBeans does not recognize this for terminating input. In fact, Ctrl-Z is an editing command in NetBeans. After each pass of user entering product information, prompt the user with a choice to continue entering product information or not. Be sure your prompt clearly tells the user what to enter depending on their choice. Using their entered response, determine whether or not you should prompt for another products information or terminate the application.



