当前位置:编程学习 > VB >>

用C#做一个银行排队系统

用C#做一个银行排队系统,要显示正在排队人数,具体怎么做,大家给点提示,最好有代码,谢谢!    --------------------编程问答-------------------- C#不是VB,应该移动此帖到 .NET下的C#版块. --------------------编程问答-------------------- 楼主发错板块了 --------------------编程问答--------------------
class 排队系统
{
    static int NewID = 1;
    staric int LastID = 1;
    void static getNewID()
    {
        Console.WriteLine("你的号码是{0},你前面还有{1}个用户在排队。", NewID, NewID - LastID);
        NewID++;
    }
    void static customFinish()
    {
        if (NewID > LastID)
        {
            Console.WriteLine("请{0}办理业务。", LastID);
            LastID++;
        }
    }
}
--------------------编程问答--------------------
完善下:

using System;

namespace 排队系统App {
class 排队系统
{
    static int NewID = 1;
    static int LastID = 1;
    public void static getNewID()
    {
        Console.WriteLine("你的号码是{0},你前面还有{1}个用户在排队。", NewID, NewID - LastID);
        NewID++;
    }
    public void static customerFinish()
    {
        if (NewID > LastID)
        {
            Console.WriteLine("请{0}办理业务。", LastID);
            LastID++;
        }
    }
}

class Program
{
    public static void Main(string[] Args)
    {
        string s = "";
        while (true)
        {
            Console.WriteLine("输入1出票,2客户离开,3退出");
            s = Console.Read();
            if (s == "1") 排队系统.getNewID();
            if (s == "2") 排队系统.customerFinish();
            if (s == "3") break;
        }
    }
}
}
--------------------编程问答--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 排队系统App
{
    class 排队系统
    {
        static int NewID = 1;
        static int LastID = 1;
        public static void getNewID()
        {
            Console.WriteLine("你的号码是{0},你前面还有{1}个用户在排队。", NewID, NewID - LastID);
            NewID++;
        }
        public static void customerFinish()
        {
            if (NewID > LastID)
            {
                Console.WriteLine("请{0}办理业务。", LastID);
                LastID++;
            }
        }
    }

    class Program
    {
        public static void Main(string[] Args)
        {
            string s = "";
            while (true)
            {
                Console.WriteLine("输入1出票,2客户离开,3退出:");
                s = Console.ReadLine();
                if (s == "1") 排队系统.getNewID();
                if (s == "2") 排队系统.customerFinish();
                if (s == "3") break;
            }
        }
    }
}
--------------------编程问答-------------------- 友情接分! --------------------编程问答-------------------- 呵呵,没有看清楚发错版块了,谢谢你们的回答。
补充:VB ,  控件
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,