This commit is contained in:
2026-10-19 16:45:02 +09:00
parent badb7eb520
commit b6af93ba98
17 changed files with 236 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ public class Atm {
if(credit < money) {
System.out.println("預金残高不足です。現金の引き出しに失敗しました。");
} else {
System.out.println("ATMの残り残高はx" + (credit - money) + "です");
System.out.println("ATMの残り残高はx" + (credit - wallet.money) + "です");
}
}

View File

@@ -3,7 +3,16 @@ public class Question11_03 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
//インスタンスの生成
Student schooldate = new Student();
schooldate.name = "太郎";
schooldate.group = "A";
schooldate.teacher = "山田";
schooldate.studentProfile();
schooldate.groupProfile();
}
}

View File

@@ -0,0 +1,16 @@
public class Student {
//フィールドの宣言
String name;
String group;
String teacher;
//メソッドの生成
public void studentProfile() {
System.out.println(name + "は" + group + "教室の生徒です。");
}
public void groupProfile() {
System.out.println(group + "教室の担任は" + teacher + "先生です。");
}
}