-
Notifications
You must be signed in to change notification settings - Fork 0
/
FoodAllergy.java
74 lines (65 loc) · 2.53 KB
/
FoodAllergy.java
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package medicaldiagnose;
import java.util.ArrayList;
public class FoodAllergy extends Symptoms{
int count=0;
FoodAllergy(){
foodallergy = new <String> ArrayList();
foodallergy.add("hives");
foodallergy.add("skin-rash");
foodallergy.add("nausea");
foodallergy.add("stomach-cramps");
foodallergy.add("indigestion");
foodallergy.add("vomiting");
foodallergy.add("diarrhea");
foodallergy.add("running-nose");
foodallergy.add("sneezing");
foodallergy.add("headaches");
foodallergy.add("asthma");
foodallergy.add("itching-mouth");
foodallergy.add("respiratory-problem");
foodallergy.add("swollen-lips");
foodallergy.add("swollen-tongue");
foodallergy.add("swollen-throat");
foodallergy.add("itching-mouth");
foodallergy.add("upset-stomach");
searchfood = new <String> ArrayList();
}
public String reason(){
String reason="\n ================== REASONS FOR FOOD ALLERGY ====================" +
"\n According to International Research, Eight Foods are responsible for 90% of Food Allergies" +
"\n 1. COW's MILK \n "
+ "2. Eggs \n "
+ "3. Peanuts \n "
+ "4. Fish \n "
+ "5. Wheat \n "
+ "6. Soy \n "
+ "7. Tree Nuts \n "
+ "8. Shell-Fish"+"\n I Assume that You recently have Eaten one of the Food that You are Allergic To! \n \t So, Please Avoid Eating That!";
return reason;
}
public void search(String symptom){
if(foodallergy.contains(symptom)){
searchfood.add(symptom);
count++;
}
}
public void result(){
System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\t\t =============> RESULT <===============");
if (count>=3){
System.out.println("\t\t " + count + " Of your Symptoms Matched for Allergy");
for (int i=0; i<searchfood.size(); i++){
System.out.println(i + ") " + searchfood.get(i));
}
System.out.println(" <--------------------------------->");
try{
Thread.sleep(5000);
}catch(InterruptedException ex){
ex.printStackTrace();
}
this.reason();
}else{
System.out.println(" " + count + " Of your Symptoms Matched for Allergy Which are Less than 3" +
"\t I would Assume that You are not Suffering from Allergy!");
}
}
}