자바 이거 에러모가 문제져 ㅡㅡ?
소리
결과가 김미소, 03434 point(022) 이런식으로 나와야되는데
결과가 김미소, 03434 point() 이런식으로 나와요...
초보라서...전혀 모르겠네요.헬프미..
public class MinusAccount extends Account {
int creaitLine;
public MinusAccount(String accunt, String ownerName,int bal, int max){
super(accunt, ownerName, bal);
creaitLine = max;
}
int withdraw(int val) throws Exception{
if(val (balance +creaitLine)) throw new Exception(잔액초과);
balance-=val;
return balance;
}
}public class PointAccount extends MinusAccount{
int point;
double pointreate;
public PointAccount(String accunt, String ownerName, int bal, int max, int p, double rate){
super(accunt,ownerName,bal,max);
point = p;
pointreate = rate;
}
void deposi(int val){
super.deposit(val);
point+=val * pointreate;
}
public String toString(){
return super.toString() + Point + point;
}
}
public class Account {
String accountNo, ownerName;
int balance;
Account (String accountNo, String ownerName, int balance){
this.accountNo = accountNo;
this.ownerName = ownerName;
this.balance = balance;
}
void deposit(int amount){
balance += amount;
}
int withdraw(int amount) throws Exception{
if (balance amount)
return 0;
balance -= amount;
return amount;
}
public String toString(){
return accountNo + / + ownerName + : + balance;
}
}
public class CheckingAccount extends Account{
String cardnum;
public CheckingAccount(String accunt, String ownerName, int bal, String cdnum){
super(accunt, ownerName, bal);
cardnum= cdnum;
}
int pay(String cdnum, int amount) throws Exception {
if(! cdnum.equals(cardnum) || amount balance){
throw new Exception(지급안되);
}
return withdraw(amount);
}
}