Actually these is not just printing text. It somehow involves logic but I keep on thinking these for almost a week. First I printed a price list then I want also to print the receipt. What can I put to eliminate the price list and then print the receipt. But before showing the receipt the price list must be shown first.

8 Years
Discussion Span
Last Post by BestJewSinceJC

If you want to print a price list and then print a receipt, one good way to do it would be to look at the similarities: both a receipt and a price list contain items. So you could build an item class that had variables such as cost and sales tax along with it, then you could have a method for printing an item's price and a method for printing the item onto a receipt. You could create an array of these items, then loop through, printing the price of each to form a price list.

If you wanted to erase the price list, you could have an array or arraylist of items, and delete each one as you went, perhaps adding them to a second list of items that would aid you in printing a receipt.

If this isn't helpful then elaborate on your question.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.