forked from kiiadi/abc-bank-c-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaxSavingsAccount.cs
37 lines (34 loc) · 912 Bytes
/
MaxSavingsAccount.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AbcBank
{
public class MaxSavingsAccount : Account
{
public MaxSavingsAccount()
{
}
public override double InterestEarned()
{
double amount = SumTransactions();
if (this.CheckIfAnyWithDrawls(10))
{
if (amount <= 1000)
return amount * 0.02;
if (amount <= 2000)
return 20 + (amount - 1000) * 0.05;
return 70 + (amount - 2000) * 0.1;
}
else
{
return amount * 0.05;
}
}
public override AccountType GetAccountType()
{
return AccountType.MAXI_SAVINGS;
}
}
}