From fa133246541ad156558092a834d7862e36a4f4f5 Mon Sep 17 00:00:00 2001 From: wanglixia <3035026499@qq.com> Date: Tue, 21 Apr 2026 11:22:19 +0800 Subject: [PATCH] W7 --- {src/w3 => w3}/AI协助记录 | 6 +- {src/w3 => w3}/BankAccount.java | 78 +++++++++--------- {src/w3 => w3}/Employee.java | 0 {src/w3 => w3}/TestEmployee.java | 0 .../屏幕截图 2026-03-25 223417.png | Bin 5 files changed, 42 insertions(+), 42 deletions(-) rename {src/w3 => w3}/AI协助记录 (82%) rename {src/w3 => w3}/BankAccount.java (97%) rename {src/w3 => w3}/Employee.java (100%) rename {src/w3 => w3}/TestEmployee.java (100%) rename {src/w3 => w3}/屏幕截图 2026-03-25 223417.png (100%) diff --git a/src/w3/AI协助记录 b/w3/AI协助记录 similarity index 82% rename from src/w3/AI协助记录 rename to w3/AI协助记录 index 76b4471..b80b229 100644 --- a/src/w3/AI协助记录 +++ b/w3/AI协助记录 @@ -1,4 +1,4 @@ -AI协助记录 -1.写了Employee类无法跑代码后了解TestEmployee测试类的作用和写法 -2.IDEA初次使用,询问AI关于IDEA写代码的操作流程 +AI协助记录 +1.写了Employee类无法跑代码后了解TestEmployee测试类的作用和写法 +2.IDEA初次使用,询问AI关于IDEA写代码的操作流程 3.AI帮助完成代码编写。 \ No newline at end of file diff --git a/src/w3/BankAccount.java b/w3/BankAccount.java similarity index 97% rename from src/w3/BankAccount.java rename to w3/BankAccount.java index 18f561d..f31cf19 100644 --- a/src/w3/BankAccount.java +++ b/w3/BankAccount.java @@ -1,40 +1,40 @@ -public class BankAccount { - private int accountNumber; - private String ownerName; - private double balance; - public BankAccount(int accountNumber,String ownerName,double balance) { - this.accountNumber = accountNumber; - this.balance = balance; - this.ownerName = ownerName; - } - public int getAccountNumber() { - return accountNumber; - } - public String getOwnerName() { - return ownerName; - } - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - public double getBalance() { - return balance; - } - //业务方法:存款 - public void deposit(double amount) { - if (amount > 0) { - balance += amount; - System.out.println("存款成功,当前余额: " + balance); - }else { - System.out.println("存款金额必须大于0"); - } - } - //业务方法:取款 - public void withdraw(double amount) { - if (amount > 0 && amount <= balance) { - balance -= amount ; - System.out.println("取款成功,当前余额: " + balance); - } else { - System.out.println("余额不足或金额无效"); - } - } +public class BankAccount { + private int accountNumber; + private String ownerName; + private double balance; + public BankAccount(int accountNumber,String ownerName,double balance) { + this.accountNumber = accountNumber; + this.balance = balance; + this.ownerName = ownerName; + } + public int getAccountNumber() { + return accountNumber; + } + public String getOwnerName() { + return ownerName; + } + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + public double getBalance() { + return balance; + } + //业务方法:存款 + public void deposit(double amount) { + if (amount > 0) { + balance += amount; + System.out.println("存款成功,当前余额: " + balance); + }else { + System.out.println("存款金额必须大于0"); + } + } + //业务方法:取款 + public void withdraw(double amount) { + if (amount > 0 && amount <= balance) { + balance -= amount ; + System.out.println("取款成功,当前余额: " + balance); + } else { + System.out.println("余额不足或金额无效"); + } + } } \ No newline at end of file diff --git a/src/w3/Employee.java b/w3/Employee.java similarity index 100% rename from src/w3/Employee.java rename to w3/Employee.java diff --git a/src/w3/TestEmployee.java b/w3/TestEmployee.java similarity index 100% rename from src/w3/TestEmployee.java rename to w3/TestEmployee.java diff --git a/src/w3/屏幕截图 2026-03-25 223417.png b/w3/屏幕截图 2026-03-25 223417.png similarity index 100% rename from src/w3/屏幕截图 2026-03-25 223417.png rename to w3/屏幕截图 2026-03-25 223417.png