首页 > 编程语言 >java入学考试修改版

java入学考试修改版

时间:2024-09-28 09:44:40浏览次数:6  
标签:java String int void private return 修改版 入学考试 public

以下是java入学测试经过模块化修改的源代码。
package mes;

public class Mesmain {
public static void main(String[] args) {
PlanManagement a=new PlanManagement();
a.menu();
}
}

package mes;

public class PlanInformation {
private int id;//日报流水表
private String planid;//生产批次
private String planname;//产品名称
private String process;//当前工序
private String nextprocess;//下一工序
private String operator;//当前操作者
private String recipient;//下一操作者
private int plannumber;//要求的产品数量
private int innumber;//接收数量
private int outnumber;//转出数量
private int missnumber;//丢失数量
private int badnumber;//废品数量
private int inspectednumber;//待检验数量
private int statement;//阶段
public PlanInformation(String planid, String planname, String process, String nextprocess, String operator,
String recipient, int plannumber, int innumber, int outnumber, int missnumber, int badnumber,
int inspectednumber, int statement)
{
super();
this.planid = planid;
this.planname = planname;
this.process = process;
this.nextprocess = nextprocess;
this.operator = operator;
this.recipient = recipient;
this.plannumber = plannumber;
this.innumber = innumber;
this.outnumber = outnumber;
this.missnumber = missnumber;
this.badnumber = badnumber;
this.inspectednumber = inspectednumber;
this.statement = statement;
}
public PlanInformation() {
super();
}

public int getId() {
	return id;
}
public void setId(int id) {
	this.id = id;
}
public void setPlanid(String planid) {
	this.planid = planid;
}
public String getPlanid() {
	return planid;
}
public String getPlanname() {
	return planname;
}
public void setPlanname(String planname) {
	this.planname = planname;
}
public String getProcess() {
	return process;
}
public void setProcess(String process) {
	this.process = process;
}
public String getNextprocess() {
	return nextprocess;
}
public void setNextprocess(String nextprocess) {
	this.nextprocess = nextprocess;
}
public String getOperator() {
	return operator;
}
public void setOperator(String operator) {
	this.operator = operator;
}
public String getRecipient() {
	return recipient;
}
public void setRecipient(String recipient) {
	this.recipient = recipient;
}
public int getPlannumber() {
	return plannumber;
}
public void setPlannumber(int plannumber) {
	this.plannumber = plannumber;
}
public int getInnumber() {
	return innumber;
}
public void setInnumber(int innumber) {
	this.innumber = innumber;
}
public int getOutnumber() {
	return outnumber;
}
public void setOutnumber(int outnumber) {
	this.outnumber = outnumber;
}
public int getMissnumber() {
	return missnumber;
}
public void setMissnumber(int missnumber) {
	this.missnumber = missnumber;
}
public int getBadnumber() {
	return badnumber;
}
public void setBadnumber(int badnumber) {
	this.badnumber = badnumber;
}
public int getInspectednumber() {
	return inspectednumber;
}
public void setInspectednumber(int inspectednumber) {
	this.inspectednumber = inspectednumber;
}
public int getStatement() {
	return statement;
}
public void setStatement(int i) {
	this.statement = i;
}

}

package mes;

import java.util.Scanner;

public class PlanManagement {
//信2305-1 20234196 尚子煊
private PlanInformation a[]=new PlanInformation[100];
private PlanInformation exp;
private int count=0;
private String[][] processTable = {
{"10", "射蜡", "柳泽羽"},
{"20", "修蜡", "藤艺哲"},
{"30", "面层", "郝一诺"},
{"40", "封浆", "杨松铎"},
{"50", "熔化", "刘宇恒"},
{"60", "切割", "陶攀印"},
{"70", "精磨", "阎琪文"},
{"80", "调型", "郝正一"},
{"90", "检验", "刘静一"}
};

	public void menu()
	{
		int i=1;
		while(i==1) 
		{
			title();
		System.out.println("				1、生成计划");
		System.out.println("				2、提交日报");
		System.out.println("				3、确认日报");
		System.out.println("				4、统计进度");
		System.out.println("***********************************************************");
		Scanner sc1=new Scanner(System.in);
		int e1=sc1.nextInt();
		switch(e1) {
		case 1:
			Planmake();
			i--;
			break;
		case 2:
			Planshangjiao();
			i--;
			break;
		case 3:
			querenPlan();
			i--;
			break;
		case 4:
			Tongji();
			i--;
			break;
		default:
			System.out.println("该选项不存在");
			break;
			}
		}
	}
	public void querenPlan() {
		Scanner sc=new Scanner(System.in);
		char c;
		title();
		System.out.print("           	请输入产品批次号:");
		String pici=sc.nextLine();
		System.out.println("***********************************************************");
		for(int i=0;i<count;i++) {
			if(a[i].getPlanid().equals(pici)&&a[i].getStatement()==1) 
			{
				title();
				System.out.println("				  1、产品批次:"+a[i].getPlanid());
				System.out.println("				  2、产品名称:"+a[i].getPlanname());
				System.out.println("				  3、计划数量:"+a[i].getPlannumber());
				System.out.println("				  4、当前工序:"+a[i].getProcess());
				System.out.println("				  5、下一工序:"+a[i].getNextprocess());
				System.out.println("				  6、操作员:"+a[i].getOperator());
				System.out.println("				  7、接收员:"+a[i].getRecipient());
				System.out.println("				  8、上一道工序转入数量:"+a[i].getInnumber());
				System.out.println("				  9、转出总数:"+a[i].getOutnumber());
				System.out.println("				  10、丢失数量:"+a[i].getMissnumber());
				System.out.println("				  11、废品数量:"+a[i].getBadnumber());
				System.out.println("				  12、待检验数量:"+a[i].getInspectednumber());
				System.out.println("***********************************************************");
				System.out.println(a[i].getStatement());
				System.out.println("该产品入库操作已完成,是否提交(Y/N)");
				System.out.println("***********************************************************");
				c=sc.next().charAt(0);
				sc.nextLine();
				if(c=='Y'||c=='y') {
					a[i].setStatement(2);
					menu();
					break;
				}
				else if(c=='N'||c=='n')
				{
					querenPlan();
					break;
				}
	}
		}
		System.out.println("无该产品");
	}
	public void Planmake()
	{
		Scanner sc1=new Scanner(System.in);
		title();
		System.out.print("				  产品批次:");
		String pici=sc1.nextLine();
		System.out.print("				  产品名称:");
		String name=sc1.nextLine();
		System.out.print("				  计划数量:");
		int num=sc1.nextInt();
		exp=new PlanInformation(pici,name,"1","2","3","4",num,0,0,0,0,0,0);
		System.out.println("该产品入库操作已完成,是否提交(Y/N)");
		System.out.println("***********************************************************");
		char c=sc1.next().charAt(0);
		if(c=='Y'||c=='y') {
			a[count]=exp;
			count++;
			menu();
		}
		else if(c=='N') {
			Planmake();
		}
	}
	public void shuchu() {
		for(int i=0;i<=count;i++) {
			System.out.println("				  1、产品批次:"+a[i].getPlanid());
			System.out.println("				  2、产品名称:"+a[i].getPlanname());
			System.out.println("				  3、计划数量:"+a[i].getPlannumber());
			System.out.println("				  4、完成数量:0");
			System.out.println("				  5、剩余数量:"+a[i].getPlannumber());
	}
	}
	public void Tongji(){
		title();
		shuchu();
		System.out.println("***********************************************************");
		System.out.println("***********************************************************");
	}
	public void title() {
		System.out.println("***********************************************************");
		System.out.println("		  石家庄铁道大学无限23软件开发有限公司");
		System.out.println("				Mes系统2023版");
		System.out.println("***********************************************************");
	}
	public void Planshangjiao()
	{
		Scanner sc=new Scanner(System.in);
		title();
		System.out.print("           	请输入产品批次号:");
		String pici=sc.nextLine();
		System.out.println("***********************************************************");
		for(int i=0;i<100;i++) {
		if(a[i].getPlanid().equals(pici)==true&&a[i].getStatement()==0) {
			title();
		System.out.println("				  1、产品批次:"+a[i].getPlanid());
		System.out.println("				  2、产品名称:"+a[i].getPlanname());
		System.out.println("				  3、计划数量:"+a[i].getPlannumber());
		System.out.print("				  4、当前工序:");
		String nowwork=sc.nextLine();
		System.out.print("				  5、下一工序:");
		String nextwork=sc.nextLine();
		System.out.print("				  6、操作员:");
		System.out.println(Manmake(nowwork));
		System.out.print("				  7、接收员:");
		System.out.println(Manmake(nextwork));
		System.out.print("				  8、上一道工序转入数量:");
		int before;
			before=sc.nextInt();
		System.out.print("				  9、转出总数:");
		int chu=sc.nextInt();
		System.out.print("				  10、丢失数量:");
		int lost=sc.nextInt();
		System.out.print("				  11、废品数量:");
		int feipin=sc.nextInt();
		System.out.print("				  12、待检验数量:");
		int check=sc.nextInt();
		if(before!=chu+lost+feipin+check) {
			System.out.println("您输入的数据有误,请稍后重新输入");
		}
		System.out.println("该产品入库操作已完成,是否提交(Y/N)");
		System.out.println("***********************************************************");
		char c=sc.next().charAt(0);
		if(c=='Y') {
			a[i].setProcess(nowwork);
			a[i].setNextprocess(nextwork);
			a[i].setOperator(Manmake(nowwork));
			a[i].setRecipient(Manmake(nextwork));
			a[i].setInnumber(before);
			a[i].setOutnumber(chu);
			a[i].setMissnumber(lost);
			a[i].setBadnumber(feipin);
			a[i].setInspectednumber(check);
			a[i].setStatement(1);
			menu();
		}
		else if(c=='N') {
			Planmake();
		}
		}
		else if(a[i].getPlanid().equals(pici)==true&&a[i].getStatement()==2) 
		{
			title();
			System.out.println("				  1、产品批次:"+a[i].getPlanid());
			System.out.println("				  2、产品名称:"+a[i].getPlanname());
			System.out.println("				  3、计划数量:"+a[i].getPlannumber());
			System.out.print("				  4、当前工序:"+a[i].getProcess());
			System.out.print("				  5、下一工序:"+a[i].getNextprocess());
			System.out.print("				  6、操作员:"+a[i].getOperator());
			System.out.print("				  7、接收员:"+a[i].getRecipient());
			System.out.print("				  8、上一道工序转入数量:"+a[i].getInnumber());
			System.out.print("				  9、转出总数:");
			int chu=sc.nextInt();
			System.out.print("				  10、丢失数量:");
			int lost=sc.nextInt();
			System.out.print("				  11、废品数量:");
			int feipin=sc.nextInt();
			System.out.print("				  12、待检验数量:");
			int check=sc.nextInt();
			if(a[i].getInnumber()!=chu+lost+feipin+check) {
				System.out.println("您输入的数据有误,请稍后重新输入");
			}
			System.out.println("该产品入库操作已完成,是否提交(Y/N)");
			System.out.println("***********************************************************");
			char c=sc.next().charAt(0);
			if(c=='Y') {
				a[i].setOutnumber(chu);
				a[i].setMissnumber(lost);
				a[i].setBadnumber(feipin);
				a[i].setInspectednumber(check);
				a[i].setStatement(1);
				menu();
			}
			else if(c=='N') {
				Planmake();
			}
		}
		else {
			System.out.println("库中没有该产品计划");
			Planshangjiao();
		}
		
	}
	}

private String Manmake(String e) {
String result=null;
if(e.equals("射蜡")true) {
result="柳泽羽";
}
else if(e.equals("修蜡")
true) {
result="藤艺哲";
}
else if(e.equals("面层")true) {
result="郝一诺";
}
else if(e.equals("封浆")
true) {
result="杨松铎";
}
else if(e.equals("熔化")true) {
result="刘宇恒";
}
else if(e.equals("切割")
true) {
result="陶攀印";
}
else if(e.equals("精磨")true) {
result="阎琪文";
}
else if(e.equals("调型")
true) {
result="郝正一";
}
else if(e.equals("检验")==true) {
result="刘静一";
}
return result;
}
}

标签:java,String,int,void,private,return,修改版,入学考试,public
From: https://www.cnblogs.com/szxworld/p/18437023

相关文章

  • Java面试题及答案整理汇总(2024最新版)
    前言辞退了老板,准备找下家,又要开始面试了,不得不准备准备八股文,还是很有必要针对性的刷一些题,很多朋友的实战能力很强,但是理论比较薄弱,要多准备准备理论知识,攻克面试官。这是我在全网寻找稍微比较完整的面试题,分享给大家**2024面试资料整理**tip:不止是收藏~学到才是自己的......
  • 免费送源码:Java+SSM+MySQL SSM线上办公系统的设计与实现 计算机毕业设计原创定制
    摘要一个企业实现办公自动化的程度是衡量其实现现代化管理的标准。办公自动化就是采用Internet技术,基于工作流的概念,使企业内部人员方便快捷地共享信息,高效协同工作。线上办公系统主要功能模块包括员工管理、部门管理、岗位管理、薪酬管理、任务下达、汇报查看、用品申请、......
  • Java多线程
    进程与线程一个程序有一个进程一个进程包含多个线程(必须有一个主线程)查看线程Threadt=Thread.currentThread();//获得当前线程线程创建方式1.继承Thread类,重写run方法,调用start方法2.实现Runnable接口,重写run方法,创建Thread对象newThread(Runnable),调用start方法......
  • java古明源2024.9.27
    EnumTest.java:packagegu;publicclassEnumTest{publicstaticvoidmain(String[]args){Sizes=Size.SMALL;Sizet=Size.LARGE;//s和t引用同一个对象?System.out.println(s==t);////是原始数据类型吗?System.out.println(s.getClass().isPrimitive());//从字符串中转换Sizeu......
  • Java Web核心技术阶段的学习要点
    JavaWeb核心技术阶段的学习要点涵盖了多个关键技术和概念,这些技术和概念对于开发动Web应用程序至关重要。以下是该阶段详细的学习要点:1.HTML/CSS/JSHTML:学习HTML的基本结构和标签,理解如何构建网页的骨架。CSS:掌握CSS的语法和选择器,学习如何使用CSS来美化网页,包括布局、颜......
  • 计算机毕业设计-基于Java+SSM架构的电影购票系统项目开发实战(附源码+论文)
    大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。......
  • 计算机毕业设计-基于Java+SSM架构的游泳会员管理系统项目开发实战(附源码+论文)
    大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。......
  • 计算机毕业设计-基于Java+SSM架构的在线电影票购买系统项目开发实战(附源码+论文)
    大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。......
  • 9.Java常用类
    Object类超类、基类,所有类的直接或间接父类,位于继承树的最顶层。任何类,如没有书写extends显式继承某个类,都默认直接继承Object类,否则为间接继承。Object类中所定义的方法,是所有对象都具备的方法。Object类型可以存储任何对象。作为参数,可接受任何对象。作为返回值,可返回任......
  • java动手动脑-2024/9/27
    publicclassEnumTest{publicstaticvoidmain(String[]args){Sizes=Size.SMALL;Sizet=Size.LARGE;//s和t引用同一个对象?System.out.println(s==t);////是原始数据类型吗?System.out.println(s.getClass().i......