Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Family
- {
- String name; //surname
- int num; //number of family members
- int numStudent; //members in highSchool
- double taxesDiscount = 0;
- public Family(String name, int numStudent, int num)
- {
- this.name = name;
- this.numStudent = numStudent;
- this.num = num;
- }
- public String getName()
- {
- return name;
- }
- public void setName(String name)
- {
- this.name = name;
- }
- public int getNum()
- {
- return num;
- }
- public void setNum(int num)
- {
- this.num = num;
- }
- public int getNumStudent()
- {
- return numStudent;
- }
- public void setNumStudent(int numStudent)
- {
- this.numStudent = numStudent;
- }
- public double getTaxesDiscount()
- {
- return taxesDiscount;
- }
- public void setTaxesDiscount(double taxes)
- {
- this.taxesDiscount = taxes;
- }
- public void reduction()
- {
- if(num > 6)
- {
- taxesDiscount = taxesDiscount + 100;
- }
- for(int i = 0 ; i > numStudent ; i ++)
- {
- taxesDiscount = taxesDiscount + 40;
- }
- }
- public void addStudents()
- {
- numStudent ++;
- }
- public void addNum()
- {
- num ++;
- }
- public String toString()
- {
- return "Family [name=" + name + ", num=" + num + ", numStudent=" + numStudent + ", taxesDiscount="+ taxesDiscount + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement