Ahmed Bin S wrote:parseInt isn't changing the String userinput into an int, instead it creates a new int using userinput.
So save the result of parseInt into an int variable and then use that variable instead of String userinput for the comparison.
Jaypee Hernandez wrote:
where is your discount variable?
you missed the closing bracket of the last else if statement, also you don't have the default else statement.
John Sing wrote:I don't use a discount variable. I used the *20, *30, and so on as the discount...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Campbell Ritchie wrote:About 15 years ago there was an article in Scientific American about slide rules. It was headed “History of Science”. I still have the slide rule I used at school.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Consider Paul's rocket mass heater. |