All pastes #2077048 Raw Edit

Anonymous

public text v1 · immutable
#2077048 ·published 2011-06-09 01:30 UTC
rendered paste body
void BirthDate::setSign(int signMonth, int signDay)
{
	string zodiac[12] = { "Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces" };
	int count = 0;

	if ( ( signMonth == 3 && signDay > 20 ) || ( signMonth == 4 && signDay < 20 ) )
		count = 0;
	if ( ( signMonth == 4 && signDay > 21 ) || ( signMonth == 5 && signDay < 21 ) )
		count = 1;
	if ( ( signMonth == 5 && signDay > 20 ) || ( signMonth == 6 && signDay < 21 ) )
		count = 2;
	if ( ( signMonth == 6 && signDay > 20 ) || ( signMonth == 7 && signDay < 23 ) )
		count = 3;
	if ( ( signMonth == 7 && signDay > 22 ) || ( signMonth == 8 && signDay < 23 ) )
		count = 4;
	if ( ( signMonth == 8 && signDay > 22 ) || ( signMonth == 9 && signDay < 23 ) )
		count = 5;
	if ( ( signMonth == 9 && signDay > 22 ) || ( signMonth == 10 && signDay < 23 ) )
		count = 6;
	if ( ( signMonth == 10 && signDay > 22 ) || ( signMonth == 11 && signDay < 22 ) )
		count = 7;
	if ( ( signMonth == 11 && signDay > 21 ) || ( signMonth == 12 && signDay < 22 ) )
		count = 8;
	if ( ( signMonth == 12 && signDay > 21 ) || ( signMonth == 1 && signDay < 20 ) )
		count = 9;
	if ( ( signMonth == 1 && signDay > 19 ) || ( signMonth == 2 && signDay < 19 ) )
		count = 10;
	if ( ( signMonth == 2 && signDay > 18 ) || ( signMonth == 3 && signDay < 21 ) )
		count = 11;
		
	zodiacSign = zodiac[count];
}