JAVA如何给程序设置一个窗口
初学者,刚刚学习了for循环,做了一个小程序的代码,我在想的是如何让这些代码不在虚拟机里运行,而是套在一个窗口里面出来?packageday04;importjava.u...
初学者,刚刚学习了for循环,做了一个小程序的代码,我在想的是如何让这些代码不在虚拟机里运行,而是套在一个窗口里面出来?
package day04;
import java.util.Scanner;
public class SwitchCanseDemo {
public static void main(String[] args) {
//100;
// 90:优秀
// 80:良好
// 70:中等
// 60:及格
//其他:不及格
Scanner console = new Scanner(System.in);
System.out.println("请您输入您的分数:");
int score =console.nextInt();
String level = "随便";
if (score<=100&&score>=0){
switch(score/10){
case 10:
case 9:
level = "优秀";
break;
case 8:
level = "良好";
break;
case 7:
level = "中等";
break;
case 6:
level = "及格";
break;
default:
level = "不及格";}
System.out.println(level);
}else{
System.out.println("对不起,您输入的分数无效");
}
} 展开
package day04;
import java.util.Scanner;
public class SwitchCanseDemo {
public static void main(String[] args) {
//100;
// 90:优秀
// 80:良好
// 70:中等
// 60:及格
//其他:不及格
Scanner console = new Scanner(System.in);
System.out.println("请您输入您的分数:");
int score =console.nextInt();
String level = "随便";
if (score<=100&&score>=0){
switch(score/10){
case 10:
case 9:
level = "优秀";
break;
case 8:
level = "良好";
break;
case 7:
level = "中等";
break;
case 6:
level = "及格";
break;
default:
level = "不及格";}
System.out.println(level);
}else{
System.out.println("对不起,您输入的分数无效");
}
} 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询