This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I've created a program that computes real estate commissions. The program prompts the user if they want to do a transaction. It then prompts them for the sale price and the property type (the property type corresponds with a certain rate). The program then calculates the commission and displays it. After the commission is displayed the program asks if you would like to do another transaction and continues to do so until the user selects no. What I want to do is when the user selects no I want the program to display the total amount of the properties entered, and the total amount of the commissions calculated (both formatted as currency).
Also, if you have time. When the user enters an incorrect property type I want the program to say that it is an incorrect property type and to enter another one. I know how to display the message I just don't know how to go back to ask for the property type again.
Outside of your big while loop, declare variables to hold the two totals and initialize them to zero. Inside your while, at the end, add the numbers for that iteration to the totals. Then after your loop, display those totals (look at the java.text.DecimalFormat class for some help with formatting numbers.)
Regarding the "ask again": Make another while loop, that encloses the prompt for property type and the if-else chain. Each branch should use "break" to terminate this while, except for the last one which prints the error message. This one should allow the loop to repeat and prompt again.