How do I fix this code so that display all customers includes new added customers and fix
Fantastic news! We've Found the answer you've been seeking!
Question:
How do I fix this code so that display all customers includes new added customers and fix the error so that it can search a five number customer ID without error
import java.util.Scanner; public class Main { public static String ArrayNames[] = new String[100]; public static int ArrayId[] = new int[100]; public static int ArraySales[] = new int[100]; public static boolean a = true; public static void main(String [] args){ Instructions(); while (a){ Instructions(); } } public static int Instructions(){ System.out.println("Enter 1 to Load Instructions"); System.out.println("Enter 2 to Load Data"); System.out.println("Enter 3 to Add new Customers"); System.out.println("Enter 4 to Display All Customers"); System.out.println("Enter 5 to Retrieve Specific Customers Data"); System.out.println("Enter 6 to Retrieve Customers with Total Sales based on Range"); System.out.println("Enter 7 to exit"); Scanner ScannerInput = new Scanner(System.in); int Selection = ScannerInput.nextInt(); switch (Selection){ case 1: Instructions(); break; case 2: LoadData(); break; case 3: AddNewCustomer(); break; case 4: DisplayData(); break; case 5: RetrieveCustData(); break; case 6: RetrieveInfoOnRange(); break; case 7: a=false; break; } return Selection; } public static void LoadData(){ System.out.println("Enter the number of customers to be loaded"); Scanner ScannerInput1 = new Scanner(System.in); int NoOfCust = ScannerInput1.nextInt(); for (int i = 0;i=Lowest_Sales && ArraySales[a]<=HighestSales){ System.out.println(ArrayId[a] + ArrayNames[a] + ArraySales[a]); } } } }
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: