So I am making a bill class, which will (hopefully) work with a Money and Date class.
So far (I only tested a little code so far) two of my method are getting a Cannot find symbol error. I have only seen this error one other time and I cannot remember how I solved it. The two lines with the obnoxious amount of stars are the placed where the code appears.
/** * Kristen Watson * CSS162A: Homework 3 * * Description: */ public class Bill{ //Variables/Data Money amount; Date dueDate; Date paidDate; String originator; //Methods public Bill(Money amount, Date dueDate, String originator){ amount = (setAmount); ************************setAmount duedate = (setDate); originator = (setOriginator); } public Bill(Bill toCopy){ } public Money getAmount(){ return amount; } public Date getDueDate(){ return dueDate; } public String getOriginator(){ return originator; } public boolean isPaid(){ if(!datePaid == null){ *****************datePaid return true; } } public void setPaid(Date onDay){ if(dueDate > paidDate){ System.out.println("The due date has passed"); }else{ paidDate = onDay; } } public void setUnpaid(){ datePaid = null; } public void setDueDate(Date nextDate){ dueDate = nextDate; } public void setAmount(Money amountGiven){ if(amountGiven > 0){ //how else should i be protecting this? amount = amountGiven; } } public void setOriginator(String originatorGiven){ originator = originatorGiven; } public String toString(){ if(datePaid == null){ return originator + "owes" + amount + "by the due date" + dueDate; }else{ return originator + "paid" + amount + "by the due date" + dueDate + "it was paid on" + datePaid; } } public boolean equals(Bill toCompare){ } }