When you enter a Value for the scanner it will check to see if the Price is between two values. If it good it does the calculations, if the Price is to high it will gave a flag tell you you need to re enter a new value. Question is what looping method do I use. Do while, if, else...
Here is what I have.
//Make a scanner for price //make a Scanner object for Price Scanner kbd2 = new Scanner(System.in); // prompt the user for data and start adding it to the object //add loop info here if wrong price System.out.print("\nEnter the Price: "); _flag = kbd2.nextDouble(); //compare Price with scanner if (price_flag > Price_set1 || price_flag < Price_set2); // see if price is less than 10000 if (price_flag == Price_set2 || price_flag > Price_set2) // cal if Price 10000 is greater than amount enter System.out.print("Incorrect Price - try again"); //tax on product create a new variables to hold the data Tax = price_flag; Tax = ((int)Tax * 0.08); // taxes on product
This post has been edited by sandy2002w: 08 March 2007 - 12:24 PM