日期:2014-05-16 浏览次数:20827 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class User
{
public string strUserName = "admin";
public string strPassWord = "admin";
public double strMoney = 1000;
}
class bank
{
User user = new User();
public void Out()
{
Console.WriteLine("==================================自助取款功能==========================");
Console.WriteLine("请输入取款金额:", user.strMoney);
double strMoney = double.Parse(Console.ReadLine());
if (strMoney <= user.strMoney)
{
user.strMoney -= strMoney;
Console.WriteLine("取款成功!");
return;
}
else
{
Console.WriteLine("余额不足!");
return;
}
}
public void In()
{
Console.WriteLine("==================================自助存款功能==========================");
Console.WriteLine("请输入存款金额:", user.strMoney);
double strMoney = double.Parse(Console.ReadLine());
user.strMoney += strMoney;
Console.WriteLine("存款成功!");
return;
}
}
class Program
{
static&n