Java Source Code

i need help with some java code

Page 1 of 1

3 Replies - 2845 Views - Last Post: 02 November 2006 - 12:31 PM Rate Topic: -----

#1 dipesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-October 06

Java Source Code

Posted 31 October 2006 - 01:15 AM

can ne1 plz help me to complete the following source code.

/**
* Simple Cash machines.
* Cash machines which can dispense twenty pound notes,
* ten pound notes and five pound notes.
* These machines also store a user's bank account balance
* (obviously this is not realistic: this will be addressed
* in the second coursework).
*
* @author Seb Hunt
* @version 3/10/2006
*/
public class CashMachine
{
// Stages 1 and 2
// declare your fields here
private int Balance;
private int TwentyPound;
private int TenPound;
private int FivePound;
private int Deposit;
private double OverdraftLimit;

/**
* Constructor for objects of class SimpleCashMachine.
* Newly created machines contain no bank notes and
* have a user balance and overdraft limit of 0.
*/
public CashMachine()
{
// Initialise your fields here.
// By default, all numeric fields are
// initialised to 0, so you may be able
// to get away with leaving this empty.
}

/**
* The user's account balance.
*/
public double getUserBalance()
{
// Stage 1
return 0.0; // replace this with something sensible
}

/**
* Add money to the user's account balance.
* @param amount the amount to add to the user's account
*/
public void deposit(double amount)
{
// Stage 1
// add your code here

}

/**
* The user's overdraft limit.
*/
public int getOverdraftLimit()
{
// Stage 2
return -1; // replace this with something sensible
}

/**
* Set the user's overdraft limit.
* @param overdraftLimit the new overdraft limit
*/
public void setOverdraftLimit(int overdraftLimit)
{
// Stage 2
// add your code here
}

/**
* Add some twenty pound notes to the machine's reserves.
* @param n the number of notes to add
*/
public void addTwenties(int n)
{
// Stage 1
// add your code here
}

/**
* Add some ten pound notes to the machine's reserves.
* @param n the number of notes to add
*/
public void addTens(int n)
{
// Stage 1
// add your code here
}

/**
* Add some five pound notes to the machine's reserves.
* @param n the number of notes to add
*/
public void addFives(int n)
{
// Stage 2
// add your code here
}

/**
* Request some cash.
* Only dispense cash if the user's account balance contains
* sufficient funds (taking into account their overdraft limit)
* and if the exact amount requested is possible
* using the machine's current reserves of bank notes.
* <p>
* Set lastRequestOK to indicate if the request was met.
* <p>
* Print messages to standard output saying what notes have
* been dispensed or explaining why the request cannot be met.
* <p>
* Update the bank note reserves and user balance accordingly.
*/
public void request(int amount)
{
// Stages 1 and 2
// add your code here
}

/**
* Was the last request for cash successful?
*/
public boolean getLastRequestOK()
{
// Stage 1
return false; // replace this with something sensible
}

/**
* The number of twenty pound notes the machine currently contains.
*/
public int getTwentiesCount()
{
// Stage 1
return -1; // replace this with something sensible
}

/**
* The number of ten pound notes the machine currently contains.
*/
public int getTensCount()
{
// Stage 1
return -1; // replace this with something sensible
}

/**
* The number of five pound notes the machine currently contains.
*/
public int getFivesCount()
{
// Stage 2
return -1; // replace this with something sensible
}

}






everything i need to do is in the above source code can ne1 plz HELP

Is This A Good Question/Topic? 0
  • +

Replies To: Java Source Code

#2 MarkoDaGeek  Icon User is offline

  • Dirty Technophile
  • member icon

Reputation: 11
  • View blog
  • Posts: 11,158
  • Joined: 13-October 01

Re: Java Source Code

Posted 31 October 2006 - 06:06 AM

Anyone*


Title edited for relevance.
Was This Post Helpful? 0
  • +
  • -

#3 psykoprogrammer  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 72
  • Joined: 09-October 06

Re: Java Source Code

Posted 31 October 2006 - 07:13 AM

An actual description of the problem you are experiencing would be good. <_<
Was This Post Helpful? 0
  • +
  • -

#4 dipesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-October 06

Re: Java Source Code

Posted 02 November 2006 - 12:31 PM

i just need to wite the code where it says to but i dnt no what to do and i need help fast can ne1 HELP???SOS
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1