/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/csharp/fundamentals/tutorials/snippets/object-oriented-programming/GiftCardAccount.cs
21 строка
625 B
Bill Wagner
Update tutorials to .NET 6 (#28404)
28 фев 2022, 21:50
Не верифицирован
28 фев 2022, 21:50
0e4df77
Код
Авторство
О чём код?
namespace OOProgramming; public class GiftCardAccount : BankAccount { // <GiftCardAccountConstruction> private readonly decimal _monthlyDeposit = 0m; public GiftCardAccount(string name, decimal initialBalance, decimal monthlyDeposit = 0) : base(name, initialBalance) => _monthlyDeposit = monthlyDeposit; // </GiftCardAccountConstruction> // <AddMonthlyDeposit> public override void PerformMonthEndTransactions() { if (_monthlyDeposit != 0) { MakeDeposit(_monthlyDeposit, DateTime.Now, "Add monthly deposit"); } } // </AddMonthlyDeposit> }