java- if 13

package com.demo.test;

import java.util.Scanner;

public class iff {
public static void main(String[] args) {
// cipher();
school(99);
}

public static void cipher() {
Scanner sc = new Scanner(System.in);
System.out.println("请输入密码:");
double password = sc.nextDouble();
if (password == 12345) {
System.out.println("密码正确!");
} else {
System.out.println("密码错误");
}
}
public static void school(double i) {
double result = i;
if (result >= 90) {
System.out.println("什么!年终奖来了,啊不是,好学生来了啊!");
} else if (result >= 60){
System.out.println("来了啊,拿成绩单发下去吧。");
}else {
System.out.println("喊你家长来!");
}
}
}

 害,跟js其实差不多,就不过多阐述了,放两个案例随便看看就好

posted @ 2023-03-02 14:07  文采呱呱  阅读(11)  评论(0编辑  收藏  举报