摘要: 1.定义一个笔记本类,该类有颜色(char)和cpu型号(int)两个属性。 [必做题]3.1 输出笔记本信息的方法3.2 然后编写一个测试类,测试笔记本类的各个方法。 public class book{ char clolr; int cpu; public void imformation() 阅读全文
posted @ 2020-04-23 12:26 慕云云尊圣 阅读(152) 评论(0) 推荐(0) 编辑
摘要: public class Rectangle{ int length; int width; public void getArea(){ System.out.println(length * width); } public void getper(){ System.out.println(( 阅读全文
posted @ 2020-04-21 17:33 慕云云尊圣 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1.有十个评委打分,(去掉一个最高和一个最低分),求平均分. public class Demon5.{ public static void main(String [] args){ double average=0.0; int max=0; int min=0; int sum=0; int 阅读全文
posted @ 2020-04-16 16:35 慕云云尊圣 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1.定义长度位5的整型数组,输入他们的值,用冒泡排序后输出.public class Demon4.{ public static void main(String[]args){ int a[]={5,4,3,8,7}; for(int i=0;i<a.length-1;i++); for(int 阅读全文
posted @ 2020-04-12 11:42 慕云云尊圣 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1.编写一个简单程序,要求数组长度为5,静态值为10,20,30,40,50.public class Demon3.{ public static void main(String[]args){ int[]arr={10,20,30,40,50}; for(int i=0;i<5;i++){ S 阅读全文
posted @ 2020-04-09 14:47 慕云云尊圣 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1.分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。public class Demon2.{ public static void main(String[]args){ int i; int sum=0; for(int i=1;i<=100;i++){ i 阅读全文
posted @ 2020-03-31 12:45 慕云云尊圣 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 输入变量x的值,如果是1,输出x=1,如果是5,输出x=5,如果是 10,输出 x=10,除了以上几个值,都输出x=noneimport java.util.Scanner; public class test{ public static void main(String[] args){ Sca 阅读全文
posted @ 2020-03-26 14:01 慕云云尊圣 阅读(172) 评论(0) 推荐(0) 编辑