C#指导学习——库存管理。本人新手求指教

C#第五章指导学习——库存管理的代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Repertory
{
class Storages
{
Goods goods = new Goods();

    Goods[] good = new Goods[3];

    //初始化信息  
    public void Initial()
    {
        good[0] = new Goods();
        good[0].GoodsName = "杯子";
        good[0].GoodsPlace = "第一仓库第一排";
        good[0].GoodsPleased = 85;
        good[0].GoodsPrice = 15;

        good[1] = new Goods();
        good[1].GoodsName = "花瓶";
        good[1].GoodsPlace = "第一仓库第二排";
        good[1].GoodsPleased = 99;
        good[1].GoodsPrice = 17.25;

        good[2] = new Goods();
        good[2].GoodsName = "热水器";
        good[2].GoodsPlace = "第一仓库第三排";
        good[2].GoodsPleased = 89;
        good[2].GoodsPrice = 100;  
    }

  //输出库存的货物名称  
    public void ShowGoods()  
    {  
        Console.WriteLine("库存货品清单列表");  
        Console.WriteLine("-------------------------------");  
        foreach (Goods item in good)  
        {  
            Console.WriteLine("货品名称:" + item.GoodsName);  
        }  
        Console.WriteLine("-------------------------------");  
    }  

    //根据货物名称获取货物位置  
    public bool GetGoodsPlace()  
    {  
        bool flag=false;  
        Console.WriteLine("请输入货品名称");  
        string name = Console.ReadLine();  
        foreach (Goods item in good)
        {  
            if (item.GoodsName.Equals(name))  
            {  
                flag = true;  
                Console.WriteLine(item.GoodsPlace);  
            }  
        }  
        return flag;  
    }  
 //满意度最高的信息  

   private void GetMaxPlease()  
    {  
        goods=GetPlease();  

        string goodsName = String.Format("客户满意度最高的货品:{0} 摆放在:{1} 满意度:{2} 价格:{3}", goods.GoodsName, goods.GoodsPlace, goods.GoodsPleased, goods.GoodsPrice);  
        Console.WriteLine("温馨提示:");   
        Console.WriteLine(goodsName);  
    }  

   private Goods GetPlease()  

    {  
        goods.GoodsPleased = 0;  
        foreach (Goods item in good)  
        {  
            if (item.GoodsPleased > goods.GoodsPleased)  
            {  
                goods.GoodsName = item.GoodsName;  
                goods.GoodsPlace = item.GoodsPlace;  
                goods.GoodsPleased = item.GoodsPleased;  
                goods.GoodsPrice = item.GoodsPrice;  
            }  
        }  
        return goods;  
    }  
    //显示菜单  
    public void ShowMenu()  
    {  
        string option = "";  
        do  
        {  
            Console.WriteLine("==================欢迎使用库存管理系统==================");  
            Console.WriteLine("1:根据货物名称获取货物位置 2:取得客户满意度最高的货品 3:退出");  
            Console.WriteLine("========================================================");  
            Console.WriteLine("请选择:");  
            option =Console.ReadLine();  
            switch (option)  
            {  
                case "1":  
                    if (GetGoodsPlace() == false)  

                        Console.WriteLine("您输入的货品名称不正确!");  

                    continue;;  
                case "2":  
                    GetMaxPlease();  

                    continue;  
                case "3":  
                    Console.WriteLine("已退出库存管理系统,谢谢您的使用");  

                    break;  
                default:  
                    Console.WriteLine("菜单选择错误,请重新输入选择!");  

                    continue;  
            }  
            break;  
        }
        while (true);  
    }  
    }



}
    运行不了

帮我看看那里错了怎么改

4个回答

怎么个运行不了
我放我我的电脑上没问题啊
报的什么错误

qq_40229591
qq_40229591 请问你怎么调用的
2 年多之前 回复

图片说明

起初是说不存在Storage这个文件

        static void Main(string[] args)
        {
            Storages s = new Storages();
            s.Initial();
            s.ShowMenu();
        }

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问