Question: please help me with my output!! its not coming out like the homework. input^^ there is two input needed i cannot add my code since

 please help me with my output!! its not coming out likethe homework. input^^ there is two input needed i cannot add my

please help me with my output!! its not coming out like the homework. input^^ there is two input needed

code since it is too long. chegg doesnt let me post it11234 55.03 25261 5000.00 37929 230.98 42465 0.00 56547 1200.45 62794 10502.6571324 0.29 24454 789.56 93165 645.32 10 4243 215.14 119691 124.23 125497221.22 139577 192.40 146440 4622.64 15 5642 2009.77 169997 3031.22 179753 132.11122643 12.13 19 1352 2315.07 202277 763.2| || 1W 1234 2.00 2w 5261 12.56 3w 7989 78.33 4 N 8465 300.00 5 d6547 5000.45 6 d 8794 3.78 7 B 1324 8 b 44549b 3165 10 D 4243 44.11 11 d 961 656.11 12 w5497 20.00 13 w 9577 255.13 14 W 6440 78.52 15 X5648 16 D 9997 311.05 17 D 9753 3000.00 18 w 264356.25 19 w 1358 892.01 20 x 2277 21 22 2 Youhave been hired as a programmer by a major bank. Your first

i cannot add my code since it is too long. chegg doesnt let me post it

11234 55.03 25261 5000.00 37929 230.98 42465 0.00 56547 1200.45 62794 10502.65 71324 0.29 24454 789.56 93165 645.32 10 4243 215.14 119691 124.23 125497 221.22 139577 192.40 146440 4622.64 15 5642 2009.77 169997 3031.22 179753 132.11 122643 12.13 19 1352 2315.07 202277 763.2| || 1W 1234 2.00 2 w 5261 12.56 3w 7989 78.33 4 N 8465 300.00 5 d 6547 5000.45 6 d 8794 3.78 7 B 1324 8 b 4454 9b 3165 10 D 4243 44.11 11 d 961 656.11 12 w 5497 20.00 13 w 9577 255.13 14 W 6440 78.52 15 X 5648 16 D 9997 311.05 17 D 9753 3000.00 18 w 2643 56.25 19 w 1358 892.01 20 x 2277 21 22 2 You have been hired as a programmer by a major bank. Your first project is a small banking transaction system. Each account consists of a number and a balance. The user of the program (the teller) can create a new account, as well as perform deposits, withdrawals, and balance inquiries. Initially, the account information of existing customers is to be read into a pair of parallel arrays--one for account numbers, the other for balances. The bank can handle up to MAX_NUM accounts. Use the following method to read in the data values: public static int readAccts(int[] acctNum, double[] balance, int maxAccts) This method fills up the account number and balance arrays (up to maxAccts) by reading from an input file until EOF is reached, and counting how many accounts are read in. It returns the actual number of accounts read in (later referred to as numAccts). After initialization, the main program prints the initial database of accounts and balances. Use method printAcets() described below. The program then allows the user to select from the following menu of transactions: Select one of the following: W - Withdrawal D- Deposit N - New account B - Balance Q- Quit X - Delete Account - Extra Credit Use the following method to produce the menu: public static void menu () This method only displays the menu. The main program then prompts the user for a selection. You should verify that the user has typed in a valid selection (otherwise print out an error message and repeat the prompt). Once the user has entered a selection, one of the following methods should be called to perform the specific transaction. At the end, before the user quits, the program prints the final contents of the account and balance arrays. public static int findAcct (int[] acct.Num, int numAccts, int account); This method returns the index of account in the acctNum array if the account exists, and -1 if it doesn't. It is called by all the remaining methods. public static void withdrawal (int[] acctNum, double[] balance, int numAccts); This method prompts the user for the account number. If the account does not exist, it prints an error message. Otherwise, it asks the user for the amount of the withdrawal. If the account does not contain sufficient funds, it prints an error message and does not perform the transaction. pubic static void deposit(int[] acct Num, double[] balance, int num_accts); This method prompts the user for the account number. If the account does not exist, it prints an error message. Otherwise, it asks the user for the amount of the deposit. public static int newAcct (int[] acct Num, double[] balance, int numAccts); This method prompts the user for a new account number. If the account already exists, it prints an error message. Otherwise, it adds the account to the acctNum array with an initial balance of 0. It returns the new number of accounts. public static void balance(int[] acetNum, double[] balance, int numAccts); This method prompts the user for an account number. If the account does not exist, it prints an error message. Otherwise, it prints the account balance. public static void printAccts (int[] acctNum, double[] balance, int numAccts); This method prints a 2-column table (with column headings) of all customer information--account numbers and balances. EXTRA CREDIT 1: public static int deleteAcct(int[] acctNum, double[] balance, int numAccts); This method prompts the user for an account number. If the account does not exist, it prints an error message. Otherwise, it deletes the account. It returns the new number of accounts. or EXTRA CREDIT 2: public static int deleteAcct(int[] acetNum, double[] balance, int numAccts); This method prompts the user for an account number. If the account does not exist, or if the account exists but has a non-zero balance, it prints an error message. Otherwise, it deletes the account. It returns the new number of accounts. Sample Output: Transaction Type: Deposit Account Number: 9876 Current Balance: $300.50 Amount to Deposit: $123.45 New Balance: $423.95 Transaction Type: Withdrawal Account Number: 9876 Current Balance: $423.95 Amount to withdraw: $765.43 Error: Insufficient Funds Available public static void main(String[] args) throws IOException { //Showing all required variables final int Max Num = 20; int numAccts = 0; int[] accNum = new int [Max_Num]; double[] balance = new double [Max_Num] ; boolean not Done = true; // Open the input file File myFile = new File("homework7ainput.txt"); //Create a Scanner object to read the input file Scanner input File = new Scanner (myFile); // Open the input file #2 File myFile1 = new File("homework7binput.txt"); //Create a Scanner object to read the input file Scanner input Filel = new Scanner (myFilel); //Create an output file object using the PrintWriter Class PrintWriter output File = new PrintWriter("homework7output.txt"); //PrintWriter outut File = new PrintWriter (System.out); menu (input File, outputFile); numAccts = readAccts(accNum, balance, numAccts, outputFile, inputFile); while (not Done) { char select; //Reading first character from each line select = inputFile1.next().charAt(0); switch (select) { //Withdrawal from account case 'W': case 'w': withdrawal (accNum, balance, numAccts, output File, input Filel); break; //Deposit into account case 'D': case 'd': deposit(accNum, balance, numAccts, outputFile, input Filel); break; //Create new Account case 'N': case 'n': numAccts = newAcct (accNum, balance, numAccts, outputFile, inputFilel); break; //Check Account Balance case 'B': case 'b': balance (accNun, balance, numAccts, output File, inputFilel); break; // Quit from Program case 'Q' : case 'q': not Done=false; printAccts (accNum, balance, numAccts, output File); break; //Delete Account from Program case 'X': case 'x': numAccts = deleteAcct(accNum, balance, numAccts, outputFile, input Filel); break; default: outputFile.println("Invalid choice"); break; } } //closing files output File.close(); System.exit(1); public static int readAccts (int[] acctNum, double[] balance, int numAccts, PrintWriter output File, Scanner inputFile) throws IOException { int index; // Start for loop for(index = 0; index = amt) { // Update the balance balance [found) -= amt; // Display success message output File.println("\tWithdrawal Successful"); } // Otherwise display error message for insufficient balance else { output File.println("\tERROR! Insufficient balance\tCurrent balance: $" + balance [found]); } } //Method to deposit amount to an account public static void deposit(int [acctNum, double []balance, int numAccts, PrintWriter output File, Scanner inputFilel) throws IOException { // Accepts account number output File.println("\tEnter the account number to deposit: "); int account = input Filel.nextInt(); // Calls the method to search account and stores found status int found = findAcct(acctNum, numAccts, account); // Checks if found status is -1 display error message if(found == -1) outputFile.println("\tERROR! This account does not exist" + account); // Otherwise account number found else { 1/ Accept deposit amount output File.println("\tEnter the deposit amount $"); double amt = input Filel.nextDouble(); // Checks if deposit amount is not negative if(amt > 0) { // Update the balance balance [found] += amt; output File.println("\t Deposit was Successful."); } else { output File.println("\tERROR: Invalid amount"); } //Method to add a new account public static int newAcct (int [lacctNum, double []balance, int numAccts, Printwriter output File, Scanner input Filel) throws IOException { // Checks if current number of accounts is less than the maximum limit account if (numAccts = amt) { // Update the balance balance [found) -= amt; // Display success message output File.println("\tWithdrawal Successful"); } // Otherwise display error message for insufficient balance else { output File.println("\tERROR! Insufficient balance\tCurrent balance: $" + balance [found]); } } //Method to deposit amount to an account public static void deposit(int [acctNum, double []balance, int numAccts, PrintWriter output File, Scanner inputFilel) throws IOException { // Accepts account number output File.println("\tEnter the account number to deposit: "); int account = input Filel.nextInt(); // Calls the method to search account and stores found status int found = findAcct(acctNum, numAccts, account); // Checks if found status is -1 display error message if(found == -1) outputFile.println("\tERROR! This account does not exist" + account); // Otherwise account number found else { 1/ Accept deposit amount output File.println("\tEnter the deposit amount $"); double amt = input Filel.nextDouble(); // Checks if deposit amount is not negative if(amt > 0) { // Update the balance balance [found] += amt; output File.println("\t Deposit was Successful."); } else { output File.println("\tERROR: Invalid amount"); } //Method to add a new account public static int newAcct (int [lacctNum, double []balance, int numAccts, Printwriter output File, Scanner input Filel) throws IOException { // Checks if current number of accounts is less than the maximum limit account if (numAccts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!