public class PiggyBankCounter; import java.util.*; public class PiggyBankCounter { //These variables are declared outside of any method so that they can be used in all methods //These variables are static so that they can be used in static methods //Arrays are declared with the square brackets to indicate that there will be multiple values of // the same type store in the one variable address //USER INPUTS variables static int[] inQuarter; static int[] inDime; static int [] inNickel; static int [] inPenny; static int maxCoinSize //program outputs variables static double tCash; static int tQuarters; static int tDimes; static int tNickels; static int tPennies; public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); maxCoinSize = 5000; for (int x = 0; x < maxCoinSize.length; x++) { System.out.print("Please enter total number of quarters you have: "); inQuarter[x] = keyboard.nextLine(); System.out.print("Please enter total number of dimes you have: "); inDime[x] = keyboard.nextLine(); System.out.print("Please enter total number of nickles you have: "); inNickle[x] = keyboard.nextLine(); System.out.print("Please enter total number of pennies you have: "); inPennies[x] = keyboard.nextInt(); keyboard.nextLine(); } //Countit Method int Q,N,D,P, qTotal, nTotal, dTotal; Q = Get inQuarter array size N = Get inNickel array size D = Get inDime array size P = Get inPenny array size qTotal = (Q + 1) * 25; nTotal = (n + 1) * 10; dTotal = (d + 1) * 5; tCash = (qTotal + nTotal + dTotal + P) / 100 ; //add quarter method set quarter array { int i; i = Get(inQuarterArraySize); Set inQuarterArraySize{ inQuarterArraySize = i ++; } tQuarters = i ++; } Call CountIt method; //add Dime method set Dime array { int i; i = Get(inDimeArraySize); Set inDimeArraySize{ inDimeArraySize = i + 1; } tDimes = i + 1; } Call CountIt method; //add Nickel method set Nickel array { int i; i = Get(inNickelArraySize); Set inNickelArraySize{ inNickelArraySize = i + 1; } tNickels = i + 1; // show total nickels in bank to user Call CountIt method; //add Penny method set Penny array { int i; i = Get(inPennyArraySize); Set inPennyArraySize{ inPennyArraySize = i + 1; } } Call CountIt method;