Sunday, 4 March 2012

Create a class to encapsulate a Monetary Transaction


Create a class to encapsulate a Monetary Transaction
Attributes:
Date - day, month, year
Time - hour, minute, second
Balance
Type - either deposit or withdraw
SerialNumber
SourceID
DestinationID
class MyTime{
 private int h, m, s;
 public MyTime(int a, int b, int c){
  h=a;
  m=b;
  s=c;
 }
}
class MyDate{}
class Transation{
 private MyDate date;
 private MyTime time;
 private double amount
 private static int serial=0;
 private long SID, DID;
 private char type;
 public Transaction(double amount, char type, long sid, long did){
  this.amount = amount;
  this.type  = type;
  SID = sid;
  DID = did; 
 }

}

 

No comments:

Post a Comment