1 Create a java file in NetBeans, name it Catalog.java.
2 Create one String array to store 3 products for a catalogue
3 Create the appropriate variables to store the product name, product code and product price.
4 At the start of the program display the catalogue for the user by looping through the array and outputting it to the screen with a number listing for each product, as shown above
5 Create an infinite loop to enter orders; to stop the loop the user should enter 0.
6 Keep a running total (accumulator) of all products amount total and sub-total (multiple accumulators)
7 Write a method to calculate the taxes and return a grand total
8 Write another method to print out the order as listed above
hadda look like this
Our catalogue [Product Codes in brackets]:
(1) Condensed Milk [M3487], $9.50 per can.
(2) Distilled Water [W3876], $3.00 a bottle.
(3) Pack Rice [R9983], $12.75 for 5lbs.
Buy something!
Enter Order Number (0 to stop): M3487
Enter Quantity: 2
Enter Order Number (0 to stop): W3876
Enter Quantity: 3
Enter Order Number (0 to stop): R9983
Enter Quantity: 3
Enter Order Number (0 to stop): 0
--- Update ---
this is the code i have so far
its not entering the if statement...can anyone help??
package catalog; import java.util.*; public class Catalog { static String products[] = new String[3]; static int answer; public static void main(String[] args) { System.out.println("------------------"); System.out.println("Shopping Catalog"); System.out.println("------------------"); String[] pCode = new String[3]; float pPrice[] = new float[3]; int orderNum = 0; int quantity=0; Scanner s = new Scanner(System.in); System.out.println("------------------------------------------"); System.out.println("condensed milk [M3487], $9.50 per can."); System.out.println(""); System.out.println("Distilled Water [W3876], $3.00 a bottle."); System.out.println(""); System.out.println("Pack Rice [R9983], $12.75 for 5lbs."); System.out.println("------------------------------------------"); do{ System.out.println("Please enter order number (0 to stop)"); pCode[orderNum] = s.nextLine(); if(pCode[orderNum] == "M3487"){ System.out.println("condensed milk $9.50"); System.out.println("Enter Quantity"); quantity = s.nextInt(); }//close if statement orderNum++; if(answer == 0){ break; }//close if }while(true);//close while loop }//close main method }//close class