该程序正在运行但没有出现?有人可以帮忙吗? [英] The program is running but nothing is showing up? Can someone help?

查看:69
本文介绍了该程序正在运行但没有出现?有人可以帮忙吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建名为BankAccountTester的项目。创建一个名为BankAccount的类。银行帐户包含余额字段。银行账户余额应初始化为0.银行账户类别应包括一笔存款,该金额会将转入的金额加到余额中,并扣除一笔金额。



我尝试过:



使用System; 
使用静态System.Console;


namespace银行
{
公共类BankAccount
{
public static void Main(string [] args)
{ }

//银行账户余额
//可以用
//撤销或存款来更改。

私人双重余额;
//构建一个银行账户
//零余额
public BankAccount()
{
balance = 0;

}
//构建一个银行账户
//给定余额
//(initalBalance)
public BankAccount(double initialBalance)
{
balance = initialBalance;
}
//将钱存入银行账户。
//(存款金额)
公共无效存款(双倍金额)
{
double newBalance =余额+金额;
balance = newBalance;
}
//从银行账户提款
//(提款金额)
public void提款(双倍金额)
{
double newBalance =余额 - 金额;
balance = newBalance;
}
//获取银行账户的当前余额。
//(返回当前余额)
public double GetBalance()
{
Console.WriteLine(您的初始余额为:$ {0});
Console.WriteLine(存款时,您的新余额为:$ {0});
Console.WriteLine(退出后,您的新余额为:$ {0});
Console.ReadLine();
返还余额;
}
}
}

解决方案

{0});
控制台.WriteLine(有了你的存款,你的新余额是:


{0});
Console.WriteLine(退出后,你的新余额是:


{0});
Console.ReadLine();
返还余额;
}
}
}


Create a project named BankAccountTester. Create a class named BankAccount. A bank account has fields for a balance. The bank account balance should be initialized to 0. The bank account class should include a deposit which adds an amount passed to it to the balance and a withdraw which subtracts the amount.

What I have tried:

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;
        }
    }
}

解决方案

{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; } } }


这篇关于该程序正在运行但没有出现?有人可以帮忙吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆