-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSavingsAccount.cs
34 lines (32 loc) · 1.11 KB
/
SavingsAccount.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MidProject2
{
class SavingsAccount : Account
{
public SavingsAccount(int accountNumber, string accountName, double balance, Address address) : base(accountNumber, accountName, balance, address)
{
}
public override void Withdraw(double ammount)
{
if(ammount > 0 && amount <= Balance-5)
{
Console.WriteLine("_____WIDRAW SUCCESSFUL_____");
Balance -= ammount;
Console.WriteLine("Current Balance: " + this.balance );
}
else
{
Console.WriteLine("_____SOMETHING WRONG!! CAN'T WIDRAW_____");
}
}
public override void ShowAccountInfo()
{
Console.WriteLine("ACCOUNT INFORMATION :\n" + "Account Number: " + this.accountNumber +
"\nName: " + this.accountName + "\nBalance: " + this.balance + "\nAddress: " + address.getAddress());
}
}
}