Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package bankcharge;
  7.  
  8. /**
  9. *
  10. * @author Charters
  11. */
  12. public class BankCharge
  13. {
  14. private String firstName;
  15. private String lastName;
  16. private String monthName;
  17. private int numberOfChecks;
  18. private double monthlyServiceFee;
  19.  
  20. //create a constructor for BankCharge here:
  21. public BankCharge(String aFirstName, String aLastName, String aMonthName, int aNumOfChecks)
  22. {
  23. firstName = aFirstName;
  24. lastName = aLastName;
  25. monthName = aMonthName;
  26. numberOfChecks = aNumOfChecks;
  27. monthlyServiceFee = 0;
  28. }
  29.  
  30. //create all the getters for the attributes here:
  31. public String getfirstName()
  32. {
  33. return firstName;
  34. }
  35. public String getlastName()
  36. {
  37. return lastName;
  38. }
  39. public String getmonthName()
  40. {
  41. return monthName;
  42. }
  43. public int getnumberOfChecks()
  44. {
  45. return numberOfChecks;
  46. }
  47. public double getmonthlyServiceFee()
  48. {
  49. return monthlyServiceFee;
  50. }
  51. //create all the setters for the attributes here:
  52.  
  53. public void setfirstName(String aFirstName)
  54. {
  55. firstName = aFirstName;
  56. }
  57. public void setlastName(String aLastName)
  58. {
  59. lastName = aLastName;
  60. }
  61. public void setmonthName(String aMonthName)
  62. {
  63. monthName = aMonthName;
  64. }
  65. public void setnumberOfChecks(int aNumOfChecks)
  66. {
  67. numberOfChecks = aNumOfChecks;
  68. }
  69. public void setmonthlyServiceFee(double aMonthlyServiceFee)
  70. {
  71. monthlyServiceFee = aMonthlyServiceFee;
  72. }
  73. //create the .toString() method here:
  74.  
  75. public String toString()
  76. {
  77. return("For the month of " + monthName + ", " + firstName + " " + lastName +" will write " + numberOfChecks + " number of checks and will be charged " + monthlyServiceFee + " fees.");
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement