Advertisement
Guest User

Untitled

a guest
May 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. package Tax_Package;
  2.  
  3. public class Individual_Customer extends Customer {
  4. private String age;
  5. private String married;
  6. private Integer kids;
  7.  
  8. //default constructor
  9. public Individual_Customer(){
  10. super(null,null,0,null);
  11. age = null;
  12. married = null;
  13. kids = 0;
  14.  
  15. }
  16. //Constructor
  17. public Individual_Customer(String userInput, Integer taxFn, Integer finYear, Tax custTax,String a, String m, Integer k) {
  18. super(userInput,taxFn,finYear,custTax);
  19. age = a;
  20. married = m;
  21. kids = k;
  22. }
  23. //Setter and Getter
  24.  
  25. public String getage() {
  26. return age;
  27. }
  28.  
  29. public void setage(String age) {
  30. age = age;
  31. }
  32.  
  33. public String getmarried() {
  34. return married;
  35. }
  36.  
  37. public void setmarried(String married) {
  38. married = married;
  39. }
  40.  
  41. public Integer getkids() {
  42. return kids;
  43. }
  44.  
  45. public void setkids(Integer kids) {
  46. kids = kids;
  47. }
  48.  
  49. //toString
  50. public String toString(){
  51. String temp = "Enter your age: "+age+"\n"+"Are you married? Y/N: "+married+"\n"+"How many kids do you have?: "
  52. +kids.toString();
  53. return temp;
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement