Программа работает, но ничего не появляется? Может кто-нибудь помочь?
Создайте проект с именем BankAccountTester. Создайте класс с именем BankAccount. Банковский счет имеет поля для баланса. Баланс банковского счета должен быть инициализирован на 0. Класс банковского счета должен включать депозит, который добавляет переданную ему сумму к балансу, и снятие, которое вычитает эту сумму.
Что я уже пробовал:
using System; using static System.Console; namespace Banking { public class BankAccount { public static void Main(string[] args) { } //A bank account has a balance //that can be changed with // withdraw or deposit. private double balance; //constructs a bank account // with zero balance public BankAccount() { balance = 0; } //Constructs a bank account //with a given balance //(initalBalance) public BankAccount(double initialBalance) { balance = initialBalance; } //Deposits money into the bank account. //(amount the amount to deposit) public void Deposit(double amount) { double newBalance = balance + amount; balance = newBalance; } //Withdraws money from the bank account //(the amount to withdraw) public void Withdraw(double amount) { double newBalance = balance - amount; balance = newBalance; } //Gets the current balance of the bank account. //(returns the current balance) public double GetBalance() { Console.WriteLine("Your initial balance is : ${0}"); Console.WriteLine(" With your deposit, your new balance is: ${0} "); Console.WriteLine("With your withdraw, your new balance is: ${0} "); Console.ReadLine(); return balance; } } }