標題:
[隨堂練習] TQC+ 201 條件判斷式
[打印本頁]
作者:
周政輝
時間:
2016-12-24 11:08
標題:
[隨堂練習] TQC+ 201 條件判斷式
輸入成績來進行判斷
import java.util.Scanner;
public class JPD02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
int num = keyboard.nextInt();
System.out.println();
test(num);
num = keyboard.nextInt();
test(num);
}
public static void test(int num) {
if(num>=60)
{
System.out.println("your pass");
}
System.out.println("End");
}
}
複製代碼
作者:
王彥甯
時間:
2016-12-24 11:08
import java.util.Scanner;
public class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
}
public static void test() {
System.out.println("Please enter score:");
int i = keyboard.nextInt();
if(i>=60)
{
System.out.println("you pass");
}
System.out.println("End");
}
}
複製代碼
作者:
蔡庭豪
時間:
2016-12-24 11:10
import java.util.Scanner;
public class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Please enter score:");
int score = keyboard.nextInt();
test(score);
System.out.println("Please enter score:");
int score2 = keyboard.nextInt();
test(score2);
}
public static void test(int score) {
if(score>=60)
System.out.println("You pass");
System.out.println("End");
}
}
複製代碼
作者:
張健勳
時間:
2016-12-24 11:14
import java.util.Scanner;
public class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Plearse enter score");
int num = keyboard.nextInt();
test(num);
num = keyboard.nextInt();
test(num);
}
public static void test(int num) {
if(num>60)
{
System.out.println("You pass");
}
System.out.println("End");
}
}
複製代碼
作者:
蔡季樺
時間:
2016-12-24 11:19
import java.util.Scanner;
public class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("please enter your score:");
int num = keyboard.nextInt();
test(num);
System.out.println("please enter your score:");
num = keyboard.nextInt();
test(num);
}
public static void test(int num) {
if(num>=60)
System.out.println("You pass");
System.out.println("End");
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2