Question: In JAVA OOP please thanks. Design a Donation class, which has: public instance variable donor which stores donors name public instance variable amount which stores
In JAVA OOP please thanks.
Design a Donation class, which has:
public instance variable donor which stores donors name
public instance variable amount which stores the amount of money a donor donates
public static property totalAmount which stores total amount of money from all donors
A constructor which can initialize donors name and amount of money donated through its parameters, then update totalAmount
Method donate with signature:
public void donate(double amt)
which increases instance variable amounts value by parameter amts value, and updates totalAmount.
Q6.3.2 Design a testing program, in this program,
Mr. Lee KC donates $100,000 initially, then he donates $8,000, $5,000 again.
Organization Foundation Two donates $10,000 initially, then it donates $5,000, $3,000, $9,000 respectively.
Print out total amount of money donated by Mr. Lee KC
Print out total amount of money donated by "Foundation Two".
Print out total amount of money by both Mr. Lee KC and "Foundation Two".
In JAVA OOP please thanks.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
