10/16自習

This commit is contained in:
2026-10-16 17:59:31 +09:00
parent 6e9775e57f
commit badb7eb520
62 changed files with 859 additions and 9 deletions

View File

@@ -0,0 +1,13 @@
public class Question02_05 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int age = 20;
int diff = 5;
System.out.println("山田さんは" + age + "歳です。");
System.out.println("5年後には" + (age + diff) + "歳になります。");
}
}

View File

@@ -0,0 +1,11 @@
public class Question02_06 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
double a = 9;
int b = 2;
System.out.println(a/b);
}
}

View File

@@ -0,0 +1,12 @@
public class Question02_07 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
double num = 1.0;
int intPositive = (int)num;
System.out.println(intPositive);
}
}

View File

@@ -0,0 +1,13 @@
public class Question02_08 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int money = 1000;
int price = 580;
double taxRate = 0.08;
System.out.println("残金は" + (money - (int)(price + (price * taxRate))) + "円です。");
}
}