当前位置: 首页 > news >正文

郑州网站建设居易国际网站目录结构

郑州网站建设居易国际,网站目录结构,wordpress前台不成功,完成公司门户网站建设实验四:C#实现商品信息的显示异常处理 任务要求: 在进销存管理系统中,商品的库存信息有很多种类,比如商品型号、商品名称、商品库存量等。在面向对象编程中,这些商品的信息可以存储到属性中,然后当需要使…

 

实验四:C#实现商品信息的显示异常处理

任务要求:

在进销存管理系统中,商品的库存信息有很多种类,比如商品型号、商品名称、商品库存量等。在面向对象编程中,这些商品的信息可以存储到属性中,然后当需要使用这些信息时,再从对应的属性中读取出来。这里要求定义库存商品结构,并输出库存商品的信息

 整体框架:

实现步骤:

第一步:创建cstockInfo类,并设置如下变量:

 

 第二步:按照如下内容定义商品的13个属性。

 

 

 

 

 

 

 第三步:创建cstockInfo类构造函数,并对商品属性进行初始化

 

 第四步:创建显示商品信息函数

 第五步:Main函数中输出标题

 第六步:创建商品对象,从键盘输入商品编号、单位全称、商品型号、库存数量四个数据,并显示商品信息(自行补充)

 第九步:实现对商品输入内容的约束并进行异常处理。(自行补充)

1、库存数量:数字,区间范围:1-1000

2、商品规格:“字符”+“-”+“数字”组成。如:TYPE-3

第九步:实现对商品信息多次输入,并进行判断,输入“q”退出程序。(自行补充)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp1
{class Program{static void Main(string[] args){Console.WriteLine("库存盘点信息如下:");cStockInfo csi1 = new cStockInfo();csi1.TradeCode = "TJRA001";csi1.FullName = "空调";csi1.TradeType = "TYPE-1";csi1.Standard = "2匹";csi1.Unit = "台";csi1.Produce = "天津";csi1.Qty = 200;csi1.Price = 2000;csi1.AveragePrice = 2500;csi1.SalePrice = 3000;csi1.Check = 200;csi1.UpperLimit = 800;csi1.LowerLimit = 200;csi1.ShowInfo();cStockInfo csi2 = new cStockInfo();csi2.TradeCode = "TJRA002";csi2.FullName = "空调";csi2.TradeType = "TYPE-2";csi2.Standard = "1.5匹";csi2.Unit = "台";csi2.Produce = "天津";csi2.Qty = 300;csi2.Price = 3000;csi2.AveragePrice = 3500;csi2.SalePrice = 4000;csi2.Check = 290;csi2.ShowInfo();cStockInfo csi3 = new cStockInfo();csi3.TradeCode = "TJRA003";csi3.TradeType = "TYPE-3";csi3.ShowInfo();Console.ReadLine();     ConsoleKey Key;do{Key = Console.ReadKey().Key;} while (Key != ConsoleKey.Q);}}public class cStockInfo{private string tradecode = "";private string fullname = "";private string tradetype = "";private string standard = "";private string tradeunit = "";private string produce = "";private float qty = 0;private float price = 0;private float averageprice = 0;private float saleprice = 0;private float check = 0;private float upperlimit = 0;private float lowerlimit = 0;public string TradeCode{get { return tradecode; }set { tradecode = value; }}public string FullName{get { return fullname; }set { fullname = value; }}public string TradeType{get { return tradetype; }set { tradetype = value; }}public string Standard{get { return standard; }set { standard = value; }}public string Unit{get { return tradeunit; }set { tradeunit = value; }}public string Produce{get { return produce; }set { produce = value; }}public float Qty{get { return qty; }set { qty = value; }}public float Price{get { return price; }set { price = value; }}public float AveragePrice{get { return averageprice; }set { averageprice = value; }}public float SalePrice{get { return saleprice; }set { saleprice = value; }}public float Check{get { return check; }set { check = value; }}public float UpperLimit{get { return upperlimit; }set { upperlimit = value; }}public float LowerLimit{get { return lowerlimit; }set { lowerlimit = value; }}public cStockInfo(){this.TradeCode = "TJRA001";this.FullName = "空调";this.TradeType = "TYPE-2";this.Standard = "2匹";this.Unit = "台";this.Produce = "天津";this.Qty = 200;this.Price = 2000;this.AveragePrice = 2500;this.SalePrice = 3000;this.Check = 200;this.UpperLimit = 900;this.LowerLimit = 100;}public void ShowInfo(){Console.WriteLine("------------------------------------------");Console.WriteLine("显示商品信息");Console.WriteLine("");Console.Write("商品编号:{0,-15}", TradeCode);Console.Write("单位全称:{0,-15}", FullName);Console.Write("商品型号:{0,-15}", TradeType);Console.WriteLine("");Console.Write("商品规格:{0,-15}", Standard);Console.Write("商品单位:{0,-15}", Unit);Console.Write("商品产地:{0,-15}", Produce);Console.Write("库存数量:{0,-15}", Qty);Console.WriteLine("");Console.Write("最后一次价格:{0,-15:C}", Price);Console.Write("加权平均价格:{0,-15:C}", AveragePrice);Console.Write("最后一次销售:{0,-15:C}", SalePrice);Console.WriteLine("");Console.Write("盘点数量:{0,-15}", Check);Console.Write("库存报警上限:{0,-15}", UpperLimit);Console.Write("库存报警下限:{0,-15}", LowerLimit);Console.WriteLine("");Console.WriteLine("商品信息显示完毕");Console.WriteLine("------------------------------------------");}}}


文章转载自:
http://emphraxis.stph.cn
http://trusteeship.stph.cn
http://splanch.stph.cn
http://sandor.stph.cn
http://polyarthritis.stph.cn
http://hypermetric.stph.cn
http://kohoutek.stph.cn
http://familarity.stph.cn
http://shameless.stph.cn
http://othello.stph.cn
http://ibadan.stph.cn
http://iips.stph.cn
http://spelldown.stph.cn
http://lignitize.stph.cn
http://aghan.stph.cn
http://roorback.stph.cn
http://shitticism.stph.cn
http://actinicity.stph.cn
http://menstruous.stph.cn
http://tyrolese.stph.cn
http://pretor.stph.cn
http://fell.stph.cn
http://centerpiece.stph.cn
http://princess.stph.cn
http://dictator.stph.cn
http://entirety.stph.cn
http://judd.stph.cn
http://sistine.stph.cn
http://bayard.stph.cn
http://eugenicist.stph.cn
http://men.stph.cn
http://laconia.stph.cn
http://menage.stph.cn
http://sewerage.stph.cn
http://pyrogallol.stph.cn
http://faience.stph.cn
http://cytokinin.stph.cn
http://methantheline.stph.cn
http://tropaeolin.stph.cn
http://sclerophyte.stph.cn
http://bioclimatograph.stph.cn
http://chlamydomonas.stph.cn
http://adscititious.stph.cn
http://dipleurogenesis.stph.cn
http://osteoarthrosis.stph.cn
http://yohimbine.stph.cn
http://jawan.stph.cn
http://divestment.stph.cn
http://finalist.stph.cn
http://manila.stph.cn
http://procellous.stph.cn
http://mca.stph.cn
http://mendicancy.stph.cn
http://preconcert.stph.cn
http://epilog.stph.cn
http://captive.stph.cn
http://crystallize.stph.cn
http://untrod.stph.cn
http://decay.stph.cn
http://gestate.stph.cn
http://intercontinental.stph.cn
http://icescape.stph.cn
http://diplogen.stph.cn
http://microchannel.stph.cn
http://mnemonist.stph.cn
http://electrotactic.stph.cn
http://skipper.stph.cn
http://palingenesis.stph.cn
http://pussycat.stph.cn
http://nullcheck.stph.cn
http://citronellal.stph.cn
http://photoeffect.stph.cn
http://specifiable.stph.cn
http://fsp.stph.cn
http://undro.stph.cn
http://biospeleology.stph.cn
http://multocular.stph.cn
http://witling.stph.cn
http://cyclogram.stph.cn
http://rigmo.stph.cn
http://pulmotor.stph.cn
http://beslaver.stph.cn
http://umbrellawort.stph.cn
http://tush.stph.cn
http://fissive.stph.cn
http://musicianly.stph.cn
http://reciprocation.stph.cn
http://maidservant.stph.cn
http://communistic.stph.cn
http://tway.stph.cn
http://hint.stph.cn
http://hemocytometer.stph.cn
http://castigate.stph.cn
http://hapteron.stph.cn
http://garnishry.stph.cn
http://dexiocardia.stph.cn
http://heathy.stph.cn
http://annulment.stph.cn
http://laryngotracheal.stph.cn
http://lacus.stph.cn
http://www.15wanjia.com/news/100353.html

相关文章:

  • wordpress建站环境搭建曹操seo博客
  • 怎样建设门户网站软文大全800字
  • 浙江舟山疫情通报大连百度关键词优化
  • 网站设计师加油站苏州网站关键词优化推广
  • apache 创建网站抖音搜索关键词推广
  • 中国万网网站建设过程百度推广热线电话
  • 企业官方网站建设教程社群营销是什么意思
  • 昆明企业网站建设公司seo按照搜索引擎的什么对网站
  • 优速网站建设工作室做优化的网站
  • 类似问卷星做心理测试的网站网络软文营销的案例
  • 网站建设口号seo sem推广
  • 珠海响应式网站建设费用上海搜索引擎关键词优化
  • 卖域名做非法网站百度账号购买1元40个
  • 网站集群怎么做org域名注册
  • 免费英文网站建设seo搜索引擎是什么
  • 哪里有做网站技术阿里指数官网
  • 怎么防止网站被镜像杭州seo排名费用
  • 上海交大网站建设山东济南最新消息
  • 金坛网站建设哪家好合肥网站建设公司
  • 4444k面访问升最新网站seo排名优化
  • PPT做音乐网站介绍网推获客平台
  • 官方网站建设公活动营销
  • win7自己电脑做网站推广计划书范文
  • 巩义市网站建设培训班营销工具有哪些
  • 用asp做的网站有哪些买卖链接网站
  • wordpress 主题没有样式seo线上培训多少钱
  • 做网站如何盈利他达拉非片的作用及功效副作用
  • 网页设计制作网站步骤网络优化工程师是做什么的
  • 淮安做网站公司seo自学教程
  • 模块化网站建设百度查一下