上传了实验二,已确认无敏感信息

This commit is contained in:
2024-06-10 16:33:43 +08:00
parent 729de600bd
commit f1190f2c2f
6 changed files with 104 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import java.util.Scanner;
public class task3 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("星级成绩评定系统");
System.out.print("请输入成绩:");
double score = input.nextDouble();
int stars = 0;
String starHanzi;
if (score > 90) {
stars = 5;
starHanzi = "";
} else if (score > 80 & score <= 90) {
stars = 4;
starHanzi = "";
} else if (score > 70 & score <= 80) {
stars = 3;
starHanzi = "";
} else if (score >= 60 & score <= 70) {
stars = 2;
starHanzi = "";
} else {
stars=0;
starHanzi="";
}
for(int i=1;i<=stars;i++){
System.out.print("*");
}
System.out.println(starHanzi+"星成绩");
}
}