/* Entry Object */
#import <Object.h>
@interface Entry : Object
{
double amount;
id acct;
}
+ new;
-setAmount:(double)theAmt;
-(double)getAmount;
-postEntry;
.
.
@end
/* Entry Object */
#import <Entry.h>
@implementation Entry
+ new
{
[super new];
}
-init;
{
acct = [Account new];
}
-setAmount:(double)theAmt
{
amount = theAmt;
}
-(double)getAmount
{
return amount;
}
-postEntry
{
[acct debitBalance:amount];
//subtract
}
.
@end
/* main */
#import <Entry.h>
main(void)
{
id Check;
Check = [Entry new];
[Check setAmount: 12.56];
[Check setPayee: "MediaScape"];
[Check postEntry];
// [Account postEntry: check];
.
[Check storeOn: "Entry.io"];
}
/* End of File */