質問編集履歴
8
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -49,7 +49,7 @@
|
|
49
49
|
|
50
50
|
peblic class Kadai{
|
51
51
|
public static void main( String args[]){
|
52
|
-
HumaenInfo hi = new HumanInfo(
|
52
|
+
HumaenInfo hi = new HumanInfo(name,ptscore,lscore);
|
53
53
|
BufferedReader br = BufferedReader(new InputStreamReader(System.in));
|
54
54
|
|
55
55
|
String hi.name = new String[5]
|
7
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -53,8 +53,8 @@
|
|
53
53
|
BufferedReader br = BufferedReader(new InputStreamReader(System.in));
|
54
54
|
|
55
55
|
String hi.name = new String[5]
|
56
|
+
int hi.ptscore = new int[5];
|
56
|
-
int hi.
|
57
|
+
int hi.lscore = new int[5];
|
57
|
-
int hi.weight = new int[5];
|
58
58
|
|
59
59
|
for(int i = 0;i < 5;++i){
|
60
60
|
System.out.println("====" + (i + 1) + " 人目====");
|
6
記述漏れ
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,14 +66,14 @@
|
|
66
66
|
}
|
67
67
|
System.out.print("前期の点数");
|
68
68
|
try{
|
69
|
-
hi.ptscore[i] = parseInt(br.readLine());
|
69
|
+
hi.ptscore[i] = Integere.parseInt(br.readLine());
|
70
70
|
}catch(Expension e){
|
71
71
|
System.out.println("例外エラーです");
|
72
72
|
}
|
73
73
|
System.o
|
74
74
|
System.out.print("後期の点数");
|
75
75
|
try{
|
76
|
-
hi.lscore[i] = parseInt(br,readLine());
|
76
|
+
hi.lscore[i] = Integera.parseInt(br,readLine());
|
77
77
|
}catch(Expension e){
|
78
78
|
System.out.println("例外エラーです");
|
79
79
|
}
|
5
記述漏れ
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,14 +66,14 @@
|
|
66
66
|
}
|
67
67
|
System.out.print("前期の点数");
|
68
68
|
try{
|
69
|
-
hi.
|
69
|
+
hi.ptscore[i] = parseInt(br.readLine());
|
70
70
|
}catch(Expension e){
|
71
71
|
System.out.println("例外エラーです");
|
72
72
|
}
|
73
73
|
System.o
|
74
74
|
System.out.print("後期の点数");
|
75
75
|
try{
|
76
|
-
hi.
|
76
|
+
hi.lscore[i] = parseInt(br,readLine());
|
77
77
|
}catch(Expension e){
|
78
78
|
System.out.println("例外エラーです");
|
79
79
|
}
|
@@ -83,7 +83,7 @@
|
|
83
83
|
|
84
84
|
System.out.print("全体の平均点を入力してください");
|
85
85
|
try{
|
86
|
-
avescore = br,readLine();
|
86
|
+
avescore = Float.parseFloat(br,readLine());
|
87
87
|
}catch(Expension e){
|
88
88
|
System.out.println("例外エラーです");
|
89
89
|
}
|
4
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
for(int i = 0;i < 5;++i){
|
98
98
|
if(hi.getScore[i] >= avescore){
|
99
|
-
System.out.println("
|
99
|
+
System.out.println("¥n" + bi.name[i] + " 点数=" + bi.getScore[i]);
|
100
100
|
++nop;
|
101
101
|
}
|
102
102
|
}
|
3
記述ミス
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Javaにて5名の生徒の
|
1
|
+
Javaにて5名の生徒の前期・後期のテストの点数の平均を算出し、入力した平均点と比較しそれ以上のものの名前と平均点を出力する
|
test
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
### 実現したいこと
|
2
|
-
Javaにて
|
2
|
+
Javaにて5人から前期と後期の点数と全体の平均点数ををキーボード入力してもらい、5人のうち平均点数以上のものは名前とその人の平均点を出力し、該当者がいない場合は「該当者はいませんでした」と出力させたい。
|
3
3
|
|
4
4
|
### 前提
|
5
5
|
クラス「HumanInfo」を作成、入力を格納しインスタンス変数を定義。
|
2
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -41,10 +41,8 @@
|
|
41
41
|
}
|
42
42
|
|
43
43
|
float getScore(){
|
44
|
-
float
|
44
|
+
float score;
|
45
|
-
|
46
|
-
temp = (float)height / 100;
|
47
|
-
score = (float)
|
45
|
+
score = ((float)ptscore + lscore) / 2
|
48
46
|
return score;
|
49
47
|
]
|
50
48
|
}
|
1
記述ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
float temp,score;
|
45
45
|
|
46
46
|
temp = (float)height / 100;
|
47
|
-
|
47
|
+
score = (float)weight / (temp * temp);
|
48
48
|
return score;
|
49
49
|
]
|
50
50
|
}
|