i have been given some source codes for which i have to make an application.
Here is a part of it:
private void manageAccount() { Account acc = null; int accId; int amount; int choice; accId = KeyboardInput.getInt("Enter Account number: "); if (!(myBank.contains(accId))) { System.out.println("Account "+ accId+" does not exist"); } else // account is found so process it as required { acc = (Account) myBank.get(accId); choice = manageMenu.getMenuChoice(); while (choice!=0) { switch (choice) // select required action on the account { case 1 : System.out.println(acc.toString()); break; case 2 : amount = KeyboardInput.getIntInRange("Enter Amount: ", 0, 9999); acc.deposit(amount); System.out.println(acc.toString()); break; case 3 : amount = KeyboardInput.getIntInRange("Enter Amount: ", 0, 9999); acc.withdraw(amount); System.out.println(acc.toString()); break; case 4 : if (acc.getClass().getName().equals("CurrentAccount")) { int newODLimit; CurrentAccount currentAcc= (CurrentAccount) acc; System.out.println("Overdraft limit is: "+currentAcc.getOverdraftLimit()); newODLimit = KeyboardInput.getIntInRange("Enter new overdraft limit: ", 0, 9999); currentAcc.setOverdraftLimit(newODLimit); } else
i have to make an application using these source codes. Howeverr i am not allowed to edit it. is there any way i can make an application which can get to these codes?
for example if the user presses the "Add an Account" button from my application, it will read the code from the AddAccount class.
or will i need to write out the codes all over again into my new Interface class?
i know i sound very confused, thats because, well i am. i was in hospital for most of my OOp classes and now have to do this resit assignment and there is no one to help! so if anyone can help me please reply! im desperate!!
p.s , i proberbly havent explaind my situation well so here is the page where my assignment is: