首页 > 其他分享 >入学测试重写

入学测试重写

时间:2023-09-18 12:44:53浏览次数:35  
标签:String 入学 System next 测试 ware 重写 sin out

import java.util.Scanner;
public class WarehouseManagement {
public void ruku(WarehouseInformation[] ware,int k){
while (true){
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
Scanner sin=new Scanner(System.in);
while(true)
{
String no;
System.out.print("商品编号:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].itemno=no;
break;
}
}
System.out.print("商品名称:");
ware[k].itemname=sin.next();
System.out.print("供货商信息:");
ware[k].suppliername=sin.next();
while(true)
{
String no;
System.out.print("入库时间:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].warehousingtime=no;
break;
}
}
while(true)
{
String no;
System.out.print("仓库编号:");
no=sin.next();
if(no.length()!=3){
System.out.println("录入错误");continue;
}
else{
ware[k].warehousenumber=no;
break;
}
}
while(true)
{
String no;
System.out.print("存放位置信息:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].warehouseplace=no;
break;
}
}
System.out.print("入库数量:");
ware[k].itemnumber=sin.nextInt();
System.out.println("该商品入库操作已完成,是否提交(Y/N)");
char pd;
pd=sin.next().charAt(0);
if(pd=='Y'){
System.out.println("**********************************************************");
break;
}
if(pd=='N'){
ware[k].itemnumber=0;
ware[k].itemno="";
ware[k].itemname="";
ware[k].warehouseplace="";
ware[k].warehousingtime="";
ware[k].suppliername="";
ware[k].shipmenttime="";
ware[k].warehousenumber="";
ware[k].outnumber=0;
}

}
}
public void xiugai(WarehouseInformation[] ware){
int k=-1;
String no;
Scanner sin=new Scanner(System.in);
while (true){
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************");
System.out.print("请输入商品编号:");
no=sin.next();
int pd=0;
for(int i=0;i< ware.length;i++){
if(ware[i].itemno.equals(no)){
k=i;
pd=1;
break;
}
}
if(pd==1){
break;
}
}
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************\n" +
"1、商品编号:"+ware[k].itemno+"\n" +
"2、商品名称:"+ware[k].itemname+"\n" +
"3、供货商信息:"+ware[k].suppliername+"\n" +
"4、入库时间:"+ware[k].warehousingtime+"\n" +
"5、存放仓库号:"+ware[k].warehousenumber+"\n" +
"6、存放位置信息:"+ware[k].warehouseplace+"\n" +
"7、入库商品数量:"+ware[k].itemnumber);
int xz;
while(true) {
System.out.print("请选择需要修改的信息编号(1-7):");
xz = sin.nextInt();
if (xz == 1) {
System.out.print("请输入修改后的编号:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemno = xg;

}break;
}
else if (xz == 2) {
System.out.print("请输入修改后的名称:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemname = xg;
}break;
}
else if (xz == 3) {
System.out.print("请输入修改后的供货商信息:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].suppliername = xg;
}break;
}
else if (xz == 4) {
System.out.print("请输入修改后的入库时间:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehousingtime = xg;
}break;
}
else if (xz == 5) {
System.out.print("请输入修改后的存放仓库号:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehousenumber = xg;
}break;
}
else if (xz == 6) {
System.out.print("请输入修改后的存放位置:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehouseplace = xg;
}break;
}
else if (xz == 7) {
System.out.print("请输入修改后的入库商品数量:");
int xg;
xg = sin.nextInt();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemnumber = xg;
}break;
}
else{
System.out.println("该选项不存在");break;
}
}
}
public void chuku(WarehouseInformation[] ware){
while(true) {
Scanner sin = new Scanner(System.in);
int k = -1;
while (true) {
k = -1;
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
System.out.print("请输入商品编号:");

String no;
no = sin.next();
for (int i = 0; i < 5; i++) {
if (ware[i].itemno.equals(no)) {
k = i;
break;
}
}
if (k != -1) {
break;
}
}
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************\n" +
"1、商品编号:" + ware[k].itemno + "\n" +
"2、商品名称:" + ware[k].itemname + "\n" +
"3、供货商信息:" + ware[k].suppliername + "\n" +
"4、入库时间:" + ware[k].warehousingtime + "\n" +
"5、存放仓库号:" + ware[k].warehousenumber + "\n" +
"6、存放位置信息:" + ware[k].warehouseplace + "\n" +
"7、入库商品数量:" + ware[k].itemnumber);
System.out.print("出库时间:");
String time;
time = sin.next();
System.out.print("出库数量:");
int ck;
ck = sin.nextInt();
System.out.println("是否保存结果(Y/N)");
char sb = sin.next().charAt(0);
if (sb == 'Y') {
ware[k].outnumber = ck;
ware[k].shipmenttime = time;
return;
}
}
}
public void pandian(WarehouseInformation[] ware) {
int k=1;
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
for(int i=0;i<5;i++){

if(ware[i].itemno.length()==8){
k++;
System.out.println(k+" 商品编号:"+ware[i].itemno+" 商品名称:"+ware[i].itemname+" 库存数量"+(ware[i].itemnumber-ware[i].outnumber));
}
}

}

}
public class WarehouseInformation {
String itemno;
String itemname;
String suppliername;
String warehousingtime;
String shipmenttime;
String warehousenumber;
String warehouseplace;
int itemnumber;
int outnumber;
public WarehouseInformation(String itemno, String itemname, String suppliername, String warehousingtime, String shipmenttime, String warehousenumber, String warehouseplace, int itemnumber, int outnumber) {
this.itemno = itemno;
this.itemname = itemname;
this.suppliername = suppliername;
this.warehousingtime = warehousingtime;
this.shipmenttime = shipmenttime;
this.warehousenumber = warehousenumber;
this.warehouseplace = warehouseplace;
this.itemnumber = itemnumber;
this.outnumber = outnumber;
}

public String getItemno() {
return itemno;
}

public void setItemno(String itemno) {
this.itemno = itemno;
}

public String getItemname() {
return itemname;
}

public void setItemname(String itemname) {
this.itemname = itemname;
}

public String getSuppliername() {
return suppliername;
}

public void setSuppliername(String suppliername) {
this.suppliername = suppliername;
}

public String getWarehousingtime() {
return warehousingtime;
}

public void setWarehousingtime(String warehousingtime) {
this.warehousingtime = warehousingtime;
}

public String getShipmenttime() {
return shipmenttime;
}

public void setShipmenttime(String shipmenttime) {
this.shipmenttime = shipmenttime;
}

public String getWarehousenumber() {
return warehousenumber;
}

public void setWarehousenumber(String warehousenumber) {
this.warehousenumber = warehousenumber;
}

public String getWarehouseplace() {
return warehouseplace;
}

public void setWarehouseplace(String warehouseplace) {
this.warehouseplace = warehouseplace;
}

public int getItemnumber() {
return itemnumber;
}

public void setItemnumber(int itemnumber) {
this.itemnumber = itemnumber;
}

public int getOutnumber() {
return outnumber;
}

public void setOutnumber(int outnumber) {
this.outnumber = outnumber;
}
}
import java.util.Scanner;
public class WarehouseManagement {
public void ruku(WarehouseInformation[] ware,int k){
while (true){
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
Scanner sin=new Scanner(System.in);
while(true)
{
String no;
System.out.print("商品编号:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].itemno=no;
break;
}
}
System.out.print("商品名称:");
ware[k].itemname=sin.next();
System.out.print("供货商信息:");
ware[k].suppliername=sin.next();
while(true)
{
String no;
System.out.print("入库时间:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].warehousingtime=no;
break;
}
}
while(true)
{
String no;
System.out.print("仓库编号:");
no=sin.next();
if(no.length()!=3){
System.out.println("录入错误");continue;
}
else{
ware[k].warehousenumber=no;
break;
}
}
while(true)
{
String no;
System.out.print("存放位置信息:");
no=sin.next();
if(no.length()!=8){
System.out.println("录入错误");continue;
}
else{
ware[k].warehouseplace=no;
break;
}
}
System.out.print("入库数量:");
ware[k].itemnumber=sin.nextInt();
System.out.println("该商品入库操作已完成,是否提交(Y/N)");
char pd;
pd=sin.next().charAt(0);
if(pd=='Y'){
System.out.println("**********************************************************");
break;
}
if(pd=='N'){
ware[k].itemnumber=0;
ware[k].itemno="";
ware[k].itemname="";
ware[k].warehouseplace="";
ware[k].warehousingtime="";
ware[k].suppliername="";
ware[k].shipmenttime="";
ware[k].warehousenumber="";
ware[k].outnumber=0;
}

}
}
public void xiugai(WarehouseInformation[] ware){
int k=-1;
String no;
Scanner sin=new Scanner(System.in);
while (true){
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************");
System.out.print("请输入商品编号:");
no=sin.next();
int pd=0;
for(int i=0;i< ware.length;i++){
if(ware[i].itemno.equals(no)){
k=i;
pd=1;
break;
}
}
if(pd==1){
break;
}
}
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************\n" +
"1、商品编号:"+ware[k].itemno+"\n" +
"2、商品名称:"+ware[k].itemname+"\n" +
"3、供货商信息:"+ware[k].suppliername+"\n" +
"4、入库时间:"+ware[k].warehousingtime+"\n" +
"5、存放仓库号:"+ware[k].warehousenumber+"\n" +
"6、存放位置信息:"+ware[k].warehouseplace+"\n" +
"7、入库商品数量:"+ware[k].itemnumber);
int xz;
while(true) {
System.out.print("请选择需要修改的信息编号(1-7):");
xz = sin.nextInt();
if (xz == 1) {
System.out.print("请输入修改后的编号:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemno = xg;

}break;
}
else if (xz == 2) {
System.out.print("请输入修改后的名称:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemname = xg;
}break;
}
else if (xz == 3) {
System.out.print("请输入修改后的供货商信息:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].suppliername = xg;
}break;
}
else if (xz == 4) {
System.out.print("请输入修改后的入库时间:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehousingtime = xg;
}break;
}
else if (xz == 5) {
System.out.print("请输入修改后的存放仓库号:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehousenumber = xg;
}break;
}
else if (xz == 6) {
System.out.print("请输入修改后的存放位置:");
String xg;
xg = sin.next();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].warehouseplace = xg;
}break;
}
else if (xz == 7) {
System.out.print("请输入修改后的入库商品数量:");
int xg;
xg = sin.nextInt();
System.out.println("是否修改(Y/N)");
char gg = sin.next().charAt(0);
if (gg == 'Y') {
ware[k].itemnumber = xg;
}break;
}
else{
System.out.println("该选项不存在");break;
}
}
}
public void chuku(WarehouseInformation[] ware){
while(true) {
Scanner sin = new Scanner(System.in);
int k = -1;
while (true) {
k = -1;
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
System.out.print("请输入商品编号:");

String no;
no = sin.next();
for (int i = 0; i < 5; i++) {
if (ware[i].itemno.equals(no)) {
k = i;
break;
}
}
if (k != -1) {
break;
}
}
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版***********************************************************\n" +
"1、商品编号:" + ware[k].itemno + "\n" +
"2、商品名称:" + ware[k].itemname + "\n" +
"3、供货商信息:" + ware[k].suppliername + "\n" +
"4、入库时间:" + ware[k].warehousingtime + "\n" +
"5、存放仓库号:" + ware[k].warehousenumber + "\n" +
"6、存放位置信息:" + ware[k].warehouseplace + "\n" +
"7、入库商品数量:" + ware[k].itemnumber);
System.out.print("出库时间:");
String time;
time = sin.next();
System.out.print("出库数量:");
int ck;
ck = sin.nextInt();
System.out.println("是否保存结果(Y/N)");
char sb = sin.next().charAt(0);
if (sb == 'Y') {
ware[k].outnumber = ck;
ware[k].shipmenttime = time;
return;
}
}
}
public void pandian(WarehouseInformation[] ware) {
int k=1;
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************");
for(int i=0;i<5;i++){

if(ware[i].itemno.length()==8){
k++;
System.out.println(k+" 商品编号:"+ware[i].itemno+" 商品名称:"+ware[i].itemname+" 库存数量"+(ware[i].itemnumber-ware[i].outnumber));
}
}

}

}

标签:String,入学,System,next,测试,ware,重写,sin,out
From: https://www.cnblogs.com/Snor9/p/17711590.html

相关文章

  • 开学测试重写
    importjava.util.Scanner;publicclassWarehouseManagement{publicstaticvoidmain(String[]args){ItemhouseInformationitem[]=newItemhouseInformation[5];while(true){menu.show();inta=0;Scannernum......
  • 9月青果网络代理IP测试,最新代理IP质量测试,有没有好的代理IP推荐?
    1.为什么要测试HTTP代理?在当今互联网大数据时代,数据采集日益发展,HTTP代理在其中扮演着重要的角色。和其他产品一样,在使用HTTP代理的时候我们也会遇到诸如:稳定性、匿名程度、响应速度、IP池可用率等问题,如何对HTTP代理进行测试,才能满足我们的需求?目前市面上很多HTTP代理都有提供试用......
  • Playwright测试REST API
    Playwright不仅可以测试Web应用,也可以访问RESTAPI进行测试。考虑以下应用场景:测试服务器端API。在进行Web应用测试前,调用一些API探测服务器状态。在Web应用测试后,调用一些API服务来进行数据验证。后面的2个选项意味着可以在测试用例中组合Web和API的测试。举例测试流程如......
  • 《最新出炉》系列初窥篇-Python+Playwright自动化测试-16-处理模态对话框弹窗
    1.简介我们在日常工作中,会经常遇到弹出警告框的问题,弹框无法绕过,必须处理才可以执行后续的测试,所以弹框处理也是我们必须掌握的一个知识。宏哥在java+selenium系列文章中介绍过这部分内容。那么,playwright对于弹框的处理是怎样的?是否比selenium更加简单呢?下面我们就来介绍一下pla......
  • CPU/内存/磁盘/网络/redis/MQ测试工具合集
    闲余时间为大家整理了CPU性能测试、内存带宽测试、内存延迟测试、磁盘IOPS测试、网络测试、数据库测试、Kafka/rabbitMQ性能测试工具合集,后续也会对工具进行简单使用说明。序号工具名称监控策略及内容1UnixBench-5.1.4CPU性能测试2stream内......
  • 测试
    专栏文章也可以单独下载,输入知乎专栏id即可批量导出知乎专栏文章为pdf周末又写了个知乎专栏批量下载工具,顺便通知个事,比如https://www.zhihu.com/column/c_1492085411900530689这个的c_1492085411900530689,导出效果:......
  • 《51测试天地》电子杂志 第七十二期:WinApp测试自动化
    《51测试天地》电子杂志第七十二期: http://www.51testing.com/html/14/n-7796614.html 在线阅读地址:http://download.51testing.com/wenzhang/51Testing_wenzhang72.pdf......
  • 《51测试天地》电子杂志 第七十三期:MacApp测试自动化
    51测试天地—原创测试文章系列(七十三):http://www.51testing.com/html/89/n-7797389.html 在线阅读地址:http://download.51testing.com/wenzhang/51Testing_wenzhang73.pdf......
  • 软件测试学习笔记
    软件测试学习笔记  看视频写笔记  目标:能复述软件测试的定义——使用技术手段验证软件是否满足需求。      能说出7种测试分类的区别      能说出质量模型的重点5项      能说出测试模板8个要素      能针对穷举场景设......
  • 测试
    importjava.util.Scanner;publicclassWarehouseManagement{publicstaticvoidmain(String[]args){WarehouseInformationware[]=newWarehouseInformation[5];ware[0]=newWarehouseInformation("20203982","华为笔记本电脑","......