From bac3c76248fb215a994a8268ec369d3d01c3ec93 Mon Sep 17 00:00:00 2001 From: a-takayama <26-a-takayama-scm@it-college.co.jp> Date: Fri, 11 Sep 2026 16:47:58 +0900 Subject: [PATCH] =?UTF-8?q?q5-1=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Question05-switch/.classpath | 6 ++++++ Question05-switch/.gitignore | 1 + Question05-switch/.project | 17 +++++++++++++++++ Question05-switch/src/PTra05_01.java | 23 ++++++++++++++++++++++- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Question05-switch/.classpath create mode 100644 Question05-switch/.gitignore create mode 100644 Question05-switch/.project diff --git a/Question05-switch/.classpath b/Question05-switch/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/Question05-switch/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/Question05-switch/.gitignore b/Question05-switch/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/Question05-switch/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/Question05-switch/.project b/Question05-switch/.project new file mode 100644 index 0000000..8d1c2c7 --- /dev/null +++ b/Question05-switch/.project @@ -0,0 +1,17 @@ + + + Question05-switch + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Question05-switch/src/PTra05_01.java b/Question05-switch/src/PTra05_01.java index 60e8a86..3c27b5a 100644 --- a/Question05-switch/src/PTra05_01.java +++ b/Question05-switch/src/PTra05_01.java @@ -21,7 +21,28 @@ public class PTra05_01 { * 変数numの値が 2 の場合 -> あなたの運勢は「中吉」です * 変数numの値が 3 の場合 -> あなたの運勢は「小吉」です * 変数numの値が 4 の場合 -> あなたの運勢は「末吉」です - * 変数numの値が 5 の場合 -> あなたの運勢は「凶」です + * 変数numの値が 5 の場合 -> あなたの運勢は「末吉」です */ + switch(num) { + case 0 : + System.out.println("あなたの運勢は「大吉」です"); + break; + case 1 : + System.out.println("あなたの運勢は「吉」です"); + break; + case 2 : + System.out.println("あなたの運勢は「中吉」です"); + break; + case 3 : + System.out.println("あなたの運勢は「小吉」です"); + break; + case 4 : + System.out.println("あなたの運勢は「末吉」です"); + break; + case 5 : + System.out.println("あなたの運勢は「末吉」です"); + break; + + } } }