![]() |
Does not show the if statements in any way?
import javax.swing.JOptionPane;Will not show me the if statements. Is it the fact I forgot to put in the InputMethod? |
Given the salesTotal and salesClass variables you have here, you have no branch to follow which results in any processing with the values provided. You do match salesTotal < 10000, but you do not match salesClass == 1. There is no else or elseif off of this branch, so no further action is taken and you exit the branch. There is no processing instructions beyond this point.
|
So how would I go about branching out?
|
I don't understand the question. You would use elseif and else clauses to continue evaluating a branch.
|
No, I mean, for it to compile, because when I compile, its like just compiling the main method. Nothing.
|
Yes, but you won't receive any output. You haven't specified a set of branch evaluations that actually lead to any useful processing or output, so it performs no tasks when run.
Look at your branch statements. You have this: Code:
if (salesTotal < 10000) // this is trueThe only way you will ever get output in this is if salesClass is set to 2. |
| All times are GMT +1. The time now is 06:32 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.