球队升级分析
//分析球队升级程序 import javax.swing.JOptionPane; public class Java_1 { public static void main(String args[]) { //初始化变量 int passes = 0, //考试及格的队员数 failures = 0, //考试不及格的队员数 student = 1, //学生计数器 result; //分析结果 String input, //输入值 output; //输出字符串 //10个队员,用计数器控制循环 while (student <= 10) { input = JOptionPane.showInputDialog( "输入队员考核结果 (1=及格,2=不及格)"); //*********Found******** result = Integer.parseInt(____________________); if (result == 1) { passes = passes + 1; } else { failures = failures + 1; } student = student + 1; } //最终分析 output = "及格: " + passes + "\n不及格: " + failures; if (passes > 8) { output = output + "\n球队升级"; } JOptionPane.showMessageDialog(null, output, "球队升级分析结果", //*********Found******** JOptionPane.____________________________); System.exit(0); } }