Professional Documents
Culture Documents
HW 11
HW 11
:
: . .
.
: !
.1
{typedef struct accountType_t
;char type
;double maxWithdrawPerDay
;double minBalance
;}AccountType
{typedef struct bankAccount_t
;]char owner[50
;]char identifier[01
;double balance
;double withdrawPerDay
;AccountType* typePtr
;} BankAccount
. ,
, . 94 ,
( )0- (
).
:
( )S ( .)B 000
1000 . , 000
. 0000
9:
)int isPositiveBalance(BankAccount *bnkac
true , ( .)0
.false
int applyTransaction(BankAccount * bnkac, double
)amount
:
0 ) hard-coded(
.0 ,)(
, (
.)/
.
,
) , (:
account: 1111
account: 2222
account: 3333
account: 4444
account: 5555
owener: David
owener: Rotem
owener: Tomer
owener: Ronit
owener: Guy
balance: 0
balance: 0
balance: 0
balance: 0
balance: 0
type: S
type: S
type: S
type: B
type: B
60
The negative balances are:
identifier: 1111
owener: David balance: -300 type: S
identifier: 4444
owener: Ronit balance: -800 type: B