-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFamily.java
More file actions
28 lines (25 loc) · 806 Bytes
/
Copy pathFamily.java
File metadata and controls
28 lines (25 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class Family {
String id;
String race;
int numberChild;
double income;
String state;
public Family() {
id = "null";
race = "null";
numberChild = 0;
income = 0.0;
state = "null";
}
public String getId() {return id;}
public String getRace() {return race;}
public int getNumberChild() {return numberChild;}
public double getIncome() {return income;}
public String getState() {return state;}
public String displayInfo() {
if(state.equals("Selangor"))
return "\nID Number :"+getId()+"\nRace : "+getRace()+"\nNumber of Childrens : "+getNumberChild()+"\nFamily's Income "+getIncome()+"\nState of residency : "+getState();
else
return "";
}
}