Using Borland C++ 3.0
Here's my code:
#include<iostream.h>
#include<conio.h>
int main()
{
int m,d;
int i=0;
clrscr();
cout<<"\nEnter Birthday month: ";
cin>>m;
cout<<"\nEnter Birthday day: ";
cin>>d;
cout<<"\n";
{
if(m==3 && d>=21)
cout<<"ARIES!";
else if (m==4 && d<=20)
cout<<"ARIES!";
else if(m==4 && d>=21)
cout<<"TAURUS!";
else if(m==5 && d<=21)
cout<<"TAURUS!";
else if(m==5 && d>=22)
cout<<"GEMINI!";
else if(m==6 && d<=21)
cout<<"GEMINI!";
else if(m==6 && d>=22)
cout<<"CANCER!";
else if(m==7 && d<=22)
cout<<"CANCER!";
else if(m==7 && d>=23)
cout<<"LEO!";
else if(m==8 && d<=21)
cout<<"LEO!";
else if(m==8 && d>=22)
cout<<"VIRGO!";
else if(m==9 && d<=23)
cout<<"VIRGO!";
else if(m==9 && d>=24)
cout<<"LIBRA!";
else if(m==10 && d<=23)
cout<<"LIBRA!";
else if(m==10 && d>=24)
cout<<"SCORPIO!";
else if(m==11 && d<=22)
cout<<"SCORPIO!";
else if(m==11 && d>=23)
cout<<"SAGITTARIUS!";
else if(m==12 && d<=22)
cout<<"SAGITTARIUS!";
else if(m==12 && d>=23)
cout<<"CAPRICORN!";
else if(m==1 && d<=20)
cout<<"CAPRICORN!";
else if(m==1 && d>=21)
cout<<"AQUARIUS!";
else if(m==2 && d<=19)
cout<<"AQUARIUS!";
else if(m==2 && d>=20)
cout<<"PISCES!";
else if(m==3 && d<=20)
cout<<"PISCES!";
else
cout<<"\nEither day or month value is invalid.";
gotoxy(35,15);
cout<<"Try again ? ";
if(getche()=='y')
{
getche();
i=0;
} else
{
i=1;
}
if (i==0)
{
gotoxy(45,2);
cout<<"Enter Birthday month: ";
cin>>m;
gotoxy(45,4);
cout<<"Enter Birthday day: ";
cin>>d;
gotoxy(45,6);
if(m==3 && d>=21)
cout<<"ARIES!";
else if (m==4 && d<=20)
cout<<"ARIES!";
else if(m==4 && d>=21)
cout<<"TAURUS!";
else if(m==5 && d<=21)
cout<<"TAURUS!";
else if(m==5 && d>=22)
cout<<"GEMINI!";
else if(m==6 && d<=21)
cout<<"GEMINI!";
else if(m==6 && d>=22)
cout<<"CANCER!";
else if(m==7 && d<=22)
cout<<"CANCER!";
else if(m==7 && d>=23)
cout<<"LEO!";
else if(m==8 && d<=21)
cout<<"LEO!";
else if(m==8 && d>=22)
cout<<"VIRGO!";
else if(m==9 && d<=23)
cout<<"VIRGO!";
else if(m==9 && d>=24)
cout<<"LIBRA!";
else if(m==10 && d<=23)
cout<<"LIBRA!";
else if(m==10 && d>=24)
cout<<"SCORPIO!";
else if(m==11 && d<=22)
cout<<"SCORPIO!";
else if(m==11 && d>=23)
cout<<"SAGITTARIUS!";
else if(m==12 && d<=22)
cout<<"SAGITTARIUS!";
else if(m==12 && d>=23)
cout<<"CAPRICORN!";
else if(m==1 && d<=20)
cout<<"CAPRICORN!";
else if(m==1 && d>=21)
cout<<"AQUARIUS!";
else if(m==2 && d<=19)
cout<<"AQUARIUS!";
else if(m==2 && d>=20)
cout<<"PISCES!";
else if(m==3 && d<=20)
cout<<"PISCES!";
else
cout<<"\nEither day or month value is invalid.";
} else {
}
getche();
return 0;
}
}
My problem is how to compare outputs and create a message.
E.g If both element message (Element is Water), a message will display saying
COMPATIBLE. If not the same element, "NOT COMPATIBLE". Of course, still basing on the
range of months and days
I really don't know how to do that cuz it's on the cout<< function.
Thanks in adance