Created
May 24, 2017 04:41
-
-
Save peter279k/e4cb3f074bf1c7d704cb793aaa9802c7 to your computer and use it in GitHub Desktop.
TQC+J AVA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class JPA02 { | |
static Scanner keyboard = new Scanner(System.in); | |
public static void main(String[] args) { | |
test(); | |
test(); | |
test(); | |
test(); | |
} | |
static void test() { | |
int chi, eng, math, avg; | |
System.out.print("Input Chinese score:"); | |
chi = keyboard.nextInt(); | |
System.out.print("Input English score:"); | |
eng = keyboard.nextInt(); | |
System.out.print("Input Math score:"); | |
math = keyboard.nextInt(); | |
if(chi < 60) { | |
System.out.println("Chinese failed."); | |
} | |
if(eng < 60) { | |
System.out.println("English failed."); | |
} | |
if(math < 60) { | |
System.out.println("Math failed."); | |
} | |
if(chi >= 60 && eng >= 60 && math >= 60) { | |
System.out.println("All pass."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment