Advertisement
aridokmecian

Untitled

Apr 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. package eecs1022.lab5;
  2.  
  3. /**
  4. * Created by user on 3/14/18.
  5. */
  6. public class Transaction {
  7. String transactionType;
  8. double amount;
  9.  
  10. //Transaction Constructor
  11. public Transaction(String transactionType, double amount){
  12. this.transactionType = transactionType;
  13. this.amount = amount;
  14. }
  15.  
  16. //toString Method
  17. @Override
  18. public String toString() {
  19. String s = "Transaction " + transactionType + ": $" + String.format("%.2f", amount);
  20. return s;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement