-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckingAccount.cs
34 lines (32 loc) · 1.12 KB
/
CheckingAccount.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 CheckingAccount : Account
{
public CheckingAccount(int accountNumber, string accountName, double balance, Address address) : base(accountNumber, accountName, balance, address)
{
}
public override void Withdraw(double ammount)
{
if (ammount > 0 && amount <= Balance)
{
Console.WriteLine("_____WITHDRAW SUCCESSFUL_____");
Balance -= ammount;
Console.WriteLine("Current Balance: " + this.balance);
}
else
{
Console.WriteLine("_____SOMETHING WRONG!! CAN'T WITHDRAW_____");
}
}
public virtual void ShowAccountInfo()
{
Console.WriteLine("ACCOUNT INFORMATION :\n" + "Account Number: " + this.accountNumber +
"\nName: " + this.accountName + "\nBalance: " + this.balance + "\nAddress: " + address.getAddress());
}
}
}