Skip to content
Permalink
cb640cc22c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
28 lines (25 sloc) 748 Bytes
//
// Account.swift
//
//
// Created by Alan Maynard on 1/23/19.
//
import Foundation
class Account: NSObject {
var accountNumber: String
var limit: Double
var balance: Double
var transactions: [Transaction]
var paymentDueDate: Date
var cycleEndDate: Date
var minimumPayment: Double
init(accountNumber: String, limit: Double, transactions: [Transaction], paymentDueDate: Date, cycleEndDate: Date) {
self.accountNumber = accountNumber
self.limit = limit
self.transactions = transactions
self.balance = transactions.map { $0.amount }.reduce(0.0, +)
self.paymentDueDate = paymentDueDate
self.cycleEndDate = cycleEndDate
self.minimumPayment = 25.00
}
}