Results 1 to 5 of 5
Thread: teach me to code.
- 08-02-2010, 10:33 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 5
- Rep Power
- 0
teach me to code.
Hi i am new to java and i am trying to fiqure out how to programme could some please help me to start of and possibly give me some pointers to help me get started off.
I have been given the fellowing class and asked to programme in these but i have no clue where to start.
package com.fdm.bank;
import java.util.List;
public class BankManager implements _BankManager
{
public BankAccountOutputVO ViewAccountSummary(String accountNumber)
{
return null;
}
public BankAccountOutputVO closeAcount(String accountNumber)
{
return null;
}
public BankAccountOutputVO createNewCurrentAccount(String name,
double amount, double overdraftLimit)
{
return null;
}
public BankAccountOutputVO createNewSavingsAccount(String name,
double amount)
{
// TODO Auto-generated method stub
return null;
}
public List<BankAccountOutputVO> listAllAccounts()
{
// TODO Auto-generated method stub
return null;
}
public BankAccountOutputVO makeDeposit(String accountNumber, double amount)
{
// TODO Auto-generated method stub
return null;
}
public BankAccountOutputVO makeWithdrawal(String accountNumber,
double amount)
{
// TODO Auto-generated method stub
return null;
}
}
//second class
package com.fdm.bank;
import java.util.List;
public interface _BankManager {
/**
* Creates a new current account and then returns details to user
* @param name
* @param amount
* @param overdraftLimit
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO createNewCurrentAccount(String name,
double amount, double overdraftLimit);
/**
*
* @param name
* @param amount
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO createNewSavingsAccount(String name,
double amount);
/**
*
* @param accountNumber
* @param amount
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO makeDeposit(String accountNumber, double amount);
/**
*
* @param accountNumber
* @param amount
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO makeWithdrawal(String accountNumber,
double amount);
/**
*
* @return The list of all accounts currently held in the bank. This list
* must consist of objects of type BankAccountOutputVO.
*/
public List<BankAccountOutputVO> listAllAccounts();
/**
*
* @param accountNumber
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO ViewAccountSummary(String accountNumber);
/**
*
* @param accountNumber
* @return The value object holding summary details for this account
*/
public BankAccountOutputVO closeAcount(String accountNumber);
}
//third class
package com.fdm.bank;
public final class BankAccountOutputVO
{
private final String accountNumber;
private final String accountType;
private final String name;
private final String balance;
private final String overdraft;
private final boolean successfulTransaction;
public BankAccountOutputVO(String accountNumber, String accountType, String name, String overdraft, String balance, boolean successfulTransaction)
{
this.accountNumber = accountNumber;
this.accountType = accountType;
this.name = name;
this.overdraft = overdraft;
this.balance = balance;
this.successfulTransaction = successfulTransaction;
}
public boolean isSuccessfulTransaction()
{
return successfulTransaction;
}
public String getAccountNumber()
{
return accountNumber;
}
public String getBalance()
{
return balance;
}
public String getName()
{
return name;
}
public String getAccountType()
{
return accountType;
}
public String getOverdraft()
{
return overdraft;
}
}
Thank youLast edited by Taher; 08-02-2010 at 11:09 AM.
- 08-02-2010, 11:56 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
You've been asked to code the BankManager class, as far as I can tell...so you need to figure out what has to go in there. Start with what data the BankManager needs to have.
-
Please don't simply dump your code or homework here and ask others to do it for you. Best to make attempts to solve this yourself first and then if you get stuck, ask a specific question. Much luck.
- 08-02-2010, 12:19 PM #4
Member
- Join Date
- Aug 2010
- Posts
- 5
- Rep Power
- 0
i am just trying to learn how to code in java. this is not a pice of home work or corsework. Thank you i got this code to help me to learn how to programme, but i am not sure where to start
I have tried to do the following but not sure how so display the information for each new account instead of hard coding the information like i have done.
package com.fdm.bank;
import java.util.List;
public class BankManager implements _BankManager
{
public BankAccountOutputVO ViewAccountSummary(String accountNumber)
{
return null;
}
public BankAccountOutputVO closeAcount(String accountNumber)
{
return null;
}
public BankAccountOutputVO createNewCurrentAccount(String name,
double amount, double overdraftLimit)
{
BankAccountOutputVO acc = new BankAccountOutputVO("10", "Currrent", "Taher", "250", "100", true);
return null;
}
public BankAccountOutputVO createNewSavingsAccount(String name,
double amount)
{
// TODO Auto-generated method stub
return null;
}
public List<BankAccountOutputVO> listAllAccounts()
{
// TODO Auto-generated method stub
return null;
}
public BankAccountOutputVO makeDeposit(String accountNumber, double amount)
{
// TODO Auto-generated method stub
return null;
}
public BankAccountOutputVO makeWithdrawal(String accountNumber,
double amount)
{
// TODO Auto-generated method stub
return null;
}
}
Thank Again for your help.Last edited by Taher; 08-02-2010 at 02:37 PM.
- 08-02-2010, 12:25 PM #5
Member
- Join Date
- Aug 2010
- Posts
- 5
- Rep Power
- 0
I have also added the fellowing clases.
package com.fdm.bank;
public class SavingAccount extends Account{
String interest;
public String getInterest()
{
return interest;
}
}
package com.fdm.bank;
public class CurrentAccount extends Account {
int overdraft;
public int setOverdraft()
{
overdraft=500;
return overdraft;
}
public int getOverdraft()
{
return overdraft;
}
}
package com.fdm.bank;
public class Account {
String name;
String accountNumber;
String balance;
String accountType;
boolean successfulTransaction;
public String getAccountNumber() {
return accountNumber;
}
public String getBalance() {
return balance;
}
public String getName() {
return name;
}
public String getAccountType() {
return accountType;
}
}
Similar Threads
-
Teach Me Pls How To Compile Java Program Using CMD
By Lilsimple in forum Java AppletsReplies: 1Last Post: 03-11-2010, 04:26 PM -
can any one pls send me a sample code for calling a jsp code in swings
By sniffer139 in forum AWT / SwingReplies: 1Last Post: 03-04-2010, 11:19 AM -
Convert java code to midlet code
By coldvoice05 in forum New To JavaReplies: 1Last Post: 08-12-2009, 11:14 AM -
Convert java code to midlet code
By coldvoice05 in forum Advanced JavaReplies: 1Last Post: 08-09-2009, 01:21 PM -
Generating Code Automatically Using Custom code Template In Eclipse
By JavaForums in forum EclipseReplies: 1Last Post: 04-26-2007, 03:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks