Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Tax_Package;
- public class Individual_Customer extends Customer {
- private String age;
- private String married;
- private Integer kids;
- //default constructor
- public Individual_Customer(){
- super(null,null,0,null);
- age = null;
- married = null;
- kids = 0;
- }
- //Constructor
- public Individual_Customer(String userInput, Integer taxFn, Integer finYear, Tax custTax,String a, String m, Integer k) {
- super(userInput,taxFn,finYear,custTax);
- age = a;
- married = m;
- kids = k;
- }
- //Setter and Getter
- public String getage() {
- return age;
- }
- public void setage(String age) {
- age = age;
- }
- public String getmarried() {
- return married;
- }
- public void setmarried(String married) {
- married = married;
- }
- public Integer getkids() {
- return kids;
- }
- public void setkids(Integer kids) {
- kids = kids;
- }
- //toString
- public String toString(){
- String temp = "Enter your age: "+age+"\n"+"Are you married? Y/N: "+married+"\n"+"How many kids do you have?: "
- +kids.toString();
- return temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement