You are on page 1of 7

-:INDEX:-

1.COMMON COLD
Symptoms of a cold usually peak within 2 to 3 days and can include:-

i) Sneezing
ii) Stuffy nose
iii) Runny nose
iv) Sore throat
v) Coughing
vi) Mucus dripping down your throat (post-nasal drip)
vii) Watery eyes
viii) Fever (although most people with colds do not have fever)

2.PINK EYE
Symptoms of conjunctivitis (pink eye) can include:-

i) Pink or red color in the white of the eye(s).


ii) Swelling of the conjunctiva (the thin layer that lines the white part of the eye
and the inside of the eyelid) and/or eyelids.
iii) Increased tear production.
iv) Feeling like a foreign body is in the eye(s) or an urge to rub the eye(s).
v) Itching, irritation, and/or burning.
vi) Discharge (pus or mucus).
vii) Crusting of eyelids or lashes, especially in the morning.
viii) Contact lenses that feel uncomfortable and/or do not stay in place on the eye.

3.Cheetah:
i) Carnivore
ii) Mammal
iii) Tawny Color
iv) Tail
v) Dark Spots

Mammal:
i) Gives milk
or
ii) Has hair
1.COMMON COLD
Symptoms of a cold usually peak within 2 to 3 days and can include:-

i) Sneezing
ii) Stuffy nose
iii) Runny nose
iv) Sore throat
v) Coughing
vi) Mucus dripping down your throat (post-nasal drip)
vii) Watery eyes
viii) Fever (although most people with colds do not have fever)

CODE:-

symptom(sneezing):- ask(sneezing,y).
symptom(stuffy_nose):- ask(stuffy_nose,y).
symptom(runny_nose):- ask(runny_nose,y).
symptom(sore_throat):- ask(sore_throat,y).
symptom(cough):- ask(cough,y).
symptom(mucus_dripping_down_your_throat):-
ask(mucus_dripping_down_your_throat,y).
symptom(watery_eyes):- ask(watery_eyes,y).

ask(sneezing,y):- write('Do you have sneezing? (y/n)'),read('y').


ask(stuffy_nose,y):- write('Do you have stuffy nose? (y/n)'), read('y').
ask(runny_nose,y):- write('Do you have runny nose? (y/n)'),read('y').
ask(sore_throat,y):- write('Do you have sore throat?(y/n)'),read('y').
ask(cough,y):- write('Do you have coughing often?(y/n)'),read('y').
ask(mucus_dripping_down_your_throat,y):- write('Do you have mucus dripping
down your throat?(y/n)'),read('y').
ask(watery_eyes,y):-write('Do you have watery eyes?(y/n)'),read('y').

disease(common_cold):-
symptom(sneezing),symptom(stuffy_nose),symptom(runny_nose),symptom(sore_thr
oat),symptom(cough),symptom(mucus_dripping_down_your_throat),symptom(water
y_eyes).
consult:- disease(Dis),!,write('You probably have '),write(Dis).
OUTPUT:-
2.PINK EYE
Symptoms of conjunctivitis (pink eye) can include:-

i) Pink or red color in the white of the eye(s).


ii) Swelling of the conjunctiva (the thin layer that lines the white part of the eye
and the inside of the eyelid) and/or eyelids.
iii) Increased tear production.
iv) Feeling like a foreign body is in the eye(s) or an urge to rub the eye(s).
v) Itching, irritation, and/or burning.
vi) Discharge (pus or mucus).
vii) Crusting of eyelids or lashes, especially in the morning.
viii) Contact lenses that feel uncomfortable and/or do not stay in place on the eye.

CODE:-
symptom(pink_red):- ask(pink_red,y).
symptom(swelling):- ask(swelling,y).
symptom(tear):- ask(tear,y).
symptom(foreign):- ask(foreign,y).
symptom(itching):- ask(itching,y).
symptom(discharge):- ask(discharge,y).
symptom(crusting):- ask(crusting,y).
symptom(uncomfortable):- ask(uncomfortable,y).

ask(pink_red,y):- write('Do you have pink or red color in white of the eye
?(y/n)'),read('y').
ask(swelling,y):- write('Do you have swelling of conjunctiva ?(y/n)'),read('y').
ask(tear,y):- write('Do you have increased tear production ?(y/n)'),read('y').
ask(foreign,y):- write('Do you have feeling of foreign body is in your eyes
?(y/n)'),read('y').
ask(itching,y):- write('Do you have itching,irritation and burning ?(y/n)'),read('y').
ask(discharge,y):- write('Do you have discharge ?(y/n)'),read('y').
ask(crusting,y):- write('Do you have crusting of eyelids or lashes, especially in the
morning ?(y/n)'),read('y').
ask(uncomfortable,y):- write('Do you have uncomfortable feeling on contact lens ?
(y/n)'),read('y').
disease(pink_eye):-
symptom(pink_red),symptom(swelling),symptom(tear),symptom(foreign),symptom(i
tching),symptom(discharge),symptom(crusting),symptom(uncomfortable).
consult:- disease(Dis),!,write('You probably have '),write(Dis).

OUTPUT:-
3.Cheetah:
i) Carnivore
ii) Mammal
iii) Tawny Color
iv) Tail
v) Dark Spots

Mammal:
i) Gives milk
or
ii) Has hair

CODE:-

verify(carni):- ask(carni,y).
verify(mammal):- check(givesmilk);check(hashair).
verify(tawnycolor):- ask(tawnycolor,y).
verify(tail):- ask(tail,y).
verify(darkspot):-ask(darkspot,y).
check(givesmilk):-ask(givesmilk,y).
check(hashair):- ask(hashair,y).

ask(carni,y):- write('Is it a carnivore ?(y/n)'),read('y').


ask(tawnycolor,y):- write('Does it have tawny color ?(y/n)'),read('y').
ask(tail,y):- write('Does it have a tail ?(y/n)'),read('y').
ask(darkspot,y):- write('Does it have a darkspot?(y/n)'),read('y').
ask(givesmilk,y):- write('Does it gives milk ?(y/n)'),read('y').
ask(hashair,y):- write('Does it have hair?(y/n)'),read('y').

animal(cheeta):-
verify(carni),verify(mammal),verify(tawnycolor),verify(tail),verify(darkspot).

find:- animal(An),!, write('The animal is probably '),write(An).


OUTPUT:-

You might also like