⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createaccount.cs

📁 csharp-solution,C#高效编程源码
💻 CS
字号:

using System;
using System.Collections;
using Banking;

// Test harness
class CreateAccount
{
    static void Main() 
    {

		// Create two bank accounts. Use Bank.CreateAccount(...) with the same balance and type
		// Store the numbers of these two accounts in long variables accNo1 and accNo2
		long accNo1 = Bank.CreateAccount(AccountType.Checking, 100);
		long accNo2 = Bank.CreateAccount(AccountType.Checking, 100);

		// Create two BankAccount variables, acc1 and acc2. 
		// Use Bank.GetAccount() to populate them with the two accounts just created
		BankAccount acc1 = Bank.GetAccount(accNo1);
		BankAccount acc2 = Bank.GetAccount(accNo2);

		// ADD CODE HERE TO SET THE NAMES OF THE ACCOUNT HOLDERS
		acc1.Holder = "Sid";
		acc2.Holder = "Ted";

		// ADD CODE HERE TO GET THE NUMBER AND TYPE OF EACH ACCOUNT
		Console.WriteLine("{0} {1} {2} {3}", acc1.Number, acc1.Type, acc2.Number, acc2.Type);

		// Print the accounts, using ToString
		Console.WriteLine("acc1 - {0}", acc1);
		Console.WriteLine("acc2 - {0}", acc2);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -