Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i = 0;
- do {
- System.out.print("Please enter the product ID to purchase.");
- String orderItem = input.nextLine();
- if (orderItem.toUpperCase() == "13WB") {
- orderNum[i] = productIDs[0];
- }
- else if (orderItem.toUpperCase() == "18WB") {
- orderNum[i] = productIDs[1];
- }
- else if (orderItem.toUpperCase() == "23WB") {
- orderNum[i] = productIDs[2];
- }
- else {
- System.out.print ("Error. Please enter a product ID.");
- orderItem = input.nextLine();
- }
- System.out.println(orderNum[i]);
- System.out.println("You entered product ID: " + orderItem);
- i ++;
- System.out.print("Would you like to order another item? \n"
- + "Enter 'y' for yes, 'n' for no.");
- doAnother = input.nextLine();
- }
- while (i < SIZE && doAnother.toLowerCase() == "y");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement