Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
right after your loop you can have a System.out.println() to achieve the purpose of showing the total number of items. Have a integer (int) variable called total out side the loop and initialise it to 0. int total = 0; Indise the loop after you get the response have an if statement and increase the total. response = EasyIn.getChar(); //get response Then outside the loop you could displace the total as the total number of items purchased. If you would like the avoid the if condition which checks for '5' you may do so and outside the loop when displaying just reduce 1 from total and display...
Replies: |
Sponsored Links
|