超市
来源:互联网 发布:2017手机号码采集软件 编辑:程序博客网 时间:2024/05/29 00:30
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Goods
{
public void show()
{
String[] goodsname = new String[3]{"电视机","电冰箱","宝宝霜"};
for (int i = 0; i < 3; i++ )
{
Console.Write(i + 1);
Console.WriteLine(goodsname[i]);
}
}
}
class Newgoods
{
public void show1()
{
int rise;
Console.WriteLine("请问您想增加几个产品呢?");
rise = Convert.ToInt32(Console.ReadLine());
String[] ngs = new String[3 + rise];
ngs[0] = "电视机";
ngs[1] = "电冰箱";
ngs[2] = "宝宝霜";
String aaa = "a";
Console.WriteLine("请输入你想增加的第一个产品:");
ngs[3] = Convert.ToString(Console.ReadLine());
for (int k = 0; k < rise - 1; k++)
{
Console.WriteLine("请输入增加的产品:");
String ng = Convert.ToString(Console.ReadLine());
ngs[k + 4] = ng;
aaa = ngs[k + 4];
}
Console.WriteLine("现在的产品有:");
for (int l = 0; l < 3 + rise; l++ )
{
Console.Write(l + 1);
Console.WriteLine(ngs[l]);
}
}
}
class Delete
{
public void show3()
{
String[] goodsname = new String[3] { "电视机", "电冰箱", "宝宝霜" };
Console.WriteLine("请输入你想删除的产品的序号:");
int num = Convert.ToInt32(Console.ReadLine());
if(num <= 100)
{
goodsname[num - 1] = null;
}
Console.WriteLine("现在的产品是:");
for(int m = 0; m < 3; m++)
{
Console.Write(m + 1);
Console.WriteLine(goodsname[m]);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int choice;
String jx;
int counter = 0;
Console.WriteLine("**********欢迎来到库存管理系统**********");
Goods g = new Goods();
Newgoods ng = new Newgoods();
jx = "y";
do
{
Console.WriteLine("请选择你想要的服务信息");
Console.WriteLine("1:查看产品信息;2:增加产品;3:删除产品");
choice = Convert.ToInt32(Console.ReadLine());
if (choice == 1 && counter == 0)
{
Console.WriteLine("以下是所有产品的信息:");
g.show();
Console.WriteLine("请选择你想要的操作(y:continue; n:end)");
jx = Convert.ToString(Console.ReadLine());
}
if(choice == 1)
{
}
if(choice == 2)
{
ng.show1();
Console.WriteLine("请选择你想要的操作(y:continue; n:end)");
jx = Convert.ToString(Console.ReadLine());
}
if(choice == 3)
{
Delete d = new Delete();
d.show3();
Console.WriteLine("请选择你想要的操作(y:continue; n:end)");
jx = Convert.ToString(Console.ReadLine());
}
counter++;
} while (jx == "y");
Console.WriteLine("欢迎下次光临!(⊙o⊙)…");
Console.WriteLine(counter);
}
}
}
- 超市
- 超市
- 超市
- 超市开业
- 宝宝超市
- 智能超市
- 超市购物
- 超市打折
- 超市管理?
- 超市抽奖
- 超市换购
- c#之超市系统之超市仓库
- C#学习超市系统之超市前台
- C#学习超市系统之超市商品
- 网页设计超市
- 麦德龙超市见闻
- 超市登录界面代码
- 精诚超市王 绿色
- SQL Server 2005 安装图解教程
- OpenSSL命令---rand
- 【练习向】jQuery基础教程第四版课后练习——Book02_jQuery_选择元素
- UDP协议
- javascript学习(10)——[知识储备]链式调用
- 超市
- Mahout实现的机器学习算法
- hdu 2546 饭卡(P01-背包)
- 工程师必备元件封装知识
- 正襟危坐说--操作系统(陆):进程同步
- Linux 中断们和陷阱门
- 读源码笔记--文件过滤驱动FileSpy第1篇 -- DriverEntry
- 小学生算数系统
- 酷比魔方Talk79拆机令人瞠目结舌