The Artima Developer Community
Sponsored Link

Java Answers Forum
In Urgent Need Of Help! Asap!

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Roob

Posts: 3
Nickname: booboo
Registered: Aug, 2002

In Urgent Need Of Help! Asap! Posted: Aug 20, 2002 6:35 PM
Reply to this message Reply
Advertisement
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:

http://mercury.tvu.ac.uk/oop/oop_ass2r.html

Topic: how can we convert a numerical to a string?? Previous Topic   Next Topic Topic: whats a deadlock ?and where and when does it happen??and how to rectify it?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use