0
評価スコアまたは教員の評価書を受け入れる場合は、ユーザーに提供するプログラムセグメントを作成します。教員の名前と得た発言を印刷する。備考(レム)以下の基準に基づいています:(remarks.java)同じ文で文字入力と浮動入力を行う方法は?
SCORE/LETTER REMARKS
4.50-5.00 or A Outstanding
4.00-4.49 or B Very Satisfactory
3.50-3.99 or C Satisfactory
3.00-3.49 or D Needs Improvement
2.99 below or E Poor
は親切に他のif文で追加するには、入力された文字の選択にどのように私を助けて。今のよう
、これは私のプログラムです:
Scanner in = new Scanner (System.in);
String n;
float score;
System.out.println("Enter Faculty's Name:");
n=in.nextLine(); //asking the user to incode his/her name
System.out.println("Enter score:");
score=in.nextFloat(); //asking the user to incode score
if (score >=4.50 )// 4.50 to 5.00
System.out.println("Remark: Outstanding");
else if(score>=4.00)// 4.00 to 4.49
System.out.println("Remark: Very Satisfactory");
else if(score>=3.50)// 3.50 to 3.99
System.out.println("Remark: Satisfactory");
else if(score>=3.00)//3.00 to 3.49
System.out.println("Remark: Needs Improvement");
else
System.out.println("Remark: Poor");
文字列として入力を許可し、それらの上にString.equals()メソッドを使用します。 –