寒假作业3

今天复习后所学习到的代码。

public class Ceonmt {
	double a;
	int b;
	double c;
	int d;
	public void show() {
		System.out.println("CPU="+a+"\n"+"主板="+b+"\n"+"显示器="+c+"\n"+"硬盘="+d);
	}

}

public class Ceonmt2 {
	public static void main(String[] args) {
		Ceonmt oun=new Ceonmt();
		oun.a=10086.11;
		oun.b=110;
		oun.c=10086.17;
		oun.d=120;
		oun.show();
	}

}




public class Lounet {
	int a;
	int b;
	int c;
	int d;
	int e;
	int f;

	public void show() {
		System.out.println("年为:" + a + "\n" + "月为:" + b + "\n" + "日为:" + c
				+ "\n" + "时为:" + d + "\n" + "分为:" + e + "\n" + "秒为:" + f);
		
	}
}

public class Lounet2 {
	public static void main(String[] args) {
		Lounet lounet =new Lounet();
		lounet.a=2018;
		lounet.b=8;
		lounet.c=27;
		lounet.d=12;
		lounet.e=36;
		lounet.f=54;
		lounet.show();
		
	}

}





public class Mnie4 {
	public static void main(String[] args) {
		int[] sise=new int[4];
		int cnut=3;
		double ine=0.0;
		double[] ligd=new double[cnut];
		int teibo=0;
		Scanner input=new Scanner(System.in);
		for(int i=0;i85){
					ine+=sise[j];
					continue;
			}
				teibo++;
		}
			ligd[i]=ine/teibo;
			System.out.println("第"+(i+1)+"个班级参赛学员的平均分是:"+ligd[i]+"\n");
	}
		System.out.println("成绩85分以上的学员人数有"+teibo+"人");
}
}




public class Mnie5 {
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		int sod = 0;
		int sait = 0;
		int oute = 0;
		do {
			System.out.println("密码:");
			sod = in.nextInt();
			if (sod == 111111) {
				System.out.println("输入取款金额:");
				oute = in.nextInt();
				if (oute % 100 != 0) {
					System.out.print("您输入的金额不合法,请重新输入:");
					continue;
				}
				break;
			} else {
				System.out.println("密码错误");
				sait++;
			}
		} while (sait < 3);
		if (sait == 3) {
			System.out.println("请取卡");
		} else {
			System.out.println("已取出:" + oute);
		}
	}
}

你可能感兴趣的:(课堂作业,作业,课作,作业)