Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Transaction() =
- let mutable seqNr = 0
- let mutable accNr = 0
- let mutable kr = 0
- let mutable cent = 0
- member x.sequenceNr
- with get() = seqNr
- and set(value) = seqNr <- value
- member x.AccountNr
- with get() = accNr
- and set(value) = accNr <- value
- member x.amountOfKr
- with get() = kr
- and set(value) = kr <- value
- member x.amountofCent
- with get() = cent
- and set(value) = cent <- value
- let dotransaction(filename:string,accountNumber:int,currentBalance:string) = let transactions = loadfile filename
- let balancearr = currentBalance.Split('.')
- let kr = System.Int32.Parse(balancearr.[0])
- let cent = System.Int32.Parse(balancearr.[1])
- let myAcc = new MyAccount(accountNr = accountNumber, accountCent = cent, accountKr = kr)
- let temper = accountNumber
- for itr in transactions do
- match itr.AccountNr with
- | accountNumber -> myAcc.ChangeBalance(itr.amountOfKr,itr.amountofCent)
- let result = myAcc.accountKr.ToString()+"."+myAcc.accountCent.ToString()
- result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement