HoroScope Problem

I can't get this program showing the zodiac sign even though i've spent plenty of time, my brain has just stopped working. Any help would be greatly appreciated

Here's my code



(date.h)
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <string>

enum Zodiac {aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces};
enum Element {fire, water, air, earth};

class Date
{
public:
Date(int month, int day, int year);
Date();

void input(); // Get Player's choice
void output();
void set(int new_month, int new_day, int new_year);
void SetSign();
void ShowSign(enum Zodiac);

bool Date::operator ==(Date rightSide);

private:

Zodiac selection;
int Zodiac, Sign;
int month, day, year;
};

**************************************************************************

date.cpp
#include "date.h"
#include <iostream>
using namespace std;

Date::Date()
{

}

Date::Date(int m, int d, int y)
{
set (m,d,y);
}

void Date::input()
// preconditions: date is entered in mm/dd/yyyy format
// postconditions: values for current object are changed to input values
{
char char1;
cout << "Enter the date in the form mm/dd/yyyy >";
cin >> month >> char1 >> day >> char1 >> year;
}

void Date::output()
// preconditions: none
// postconditions: date is displayed in mm/dd/yyyy format
{
cout << month << "/" << day << '/' << year << endl;
}

void Date::set(int new_month, int new_day, int new_year)
//Precondition: new_month and new_day form a possible date.
//Postcondition: The date is reset according to the arguments.
{
month = new_month;
day = new_day;
year = new_year;
}

bool Date::operator ==(Date rightSide)
// preconditions: none
// postconditions: return true when rightSide.day and rightSide.month are the same
// as day and month
// otherwise returns false
{
bool same = false;
if ( day == rightSide.day && month == rightSide.month )
same = true;

return same;
}

void Date::SetSign()
{
int zodiac=0;


enum Zodiac {aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces};
Zodiac selection;

if (month==3&&day>=21 || month==4&&day<20)
zodiac = 0;
else if(month==4&&day>=21 || month==5&&day<=21)
zodiac = 1;
else if(month==5&&day>=22 || month==6&&day<=21)
zodiac = 2;
else if(month==6&&day>=22 || month==7&&day<=22)
zodiac = 3;
else if(month==7&&day>=23 || month==8&&day<=21)
zodiac = 4;
else if(month==8&&day>=22 || month==9&&day<=23)
zodiac = 5;
else if(month==9&&day>=24 || month==10&&day<=23)
zodiac = 6;
else if(month==10&&day>=24 || month==11&&day<=22)
zodiac = 7;
else if(month==11&&day>=23 || month==12&&day<=22)
zodiac = 8;
else if(month==12&&day>=23 || month==1&&day<=20)
zodiac = 9;
else if(month==1&&day>=21 || month==2&&day<=19)
zodiac = 10;
else if(month==2&&day>=20 || month==2&&day<=20)
zodiac = 11;

switch(zodiac)
{
case 0: Sign = aries; break;
case 1: Sign = taurus; break;
case 2: Sign = gemini; break;
case 3: Sign = cancer; break;
case 4: Sign = leo; break;
case 5: Sign = virgo; break;
case 6: Sign = libra; break;
case 7: Sign = scorpio; break;
case 8: Sign = sagittarius; break;
case 9: Sign = capricorn; break;
case 10: Sign = aquarius; break;
case 11: Sign = pisces; break;
}

selection == Sign;

switch(selection)
{
case aries: cout << " Aries\n"; break;
case taurus: cout << " Taurus\n";break;
case gemini: cout << " Gemini\n"; break;
case cancer: cout << " Cancer\n"; break;
case leo: cout << " Leo\n";break;
case virgo: cout << " Virgo\n"; break;
case libra: cout << " Libra\n"; break;
case scorpio: cout << " Scorpio\n";break;
case sagittarius: cout << " Sagittarius\n"; break;
case capricorn: cout << " Capricorn\n"; break;
case aquarius: cout << " Aquarius\n";break;
case pisces: cout << " Pisces\n"; break;
}
}

*************************************************************************
test.cpp

#include "date.h"
#include <iostream>

using namespace std;


int main()
{

Date today;

today.input();

cout << "\nNow today is ";
today.output();

Date birthday;

cout << " When is your birthday? ";
birthday.input();

cout << " Your birthday is ";
birthday.output();


Date ShowZodiac;

cout << "\nYour zodiac sign is ";
ShowZodiac.SetSign();

if (today == birthday)
cout << "\n\nHappy Birthday!\n\n";
return 0;
}

What's the problem?

Does it not compile or it doesnt do what you want it to do?
It does compile however it doesn't output the zodiac sign after you input your birth date. I'm pretty sure I'm missing something in my SetSign function which is

void Date::SetSign()
{
int zodiac=0;


enum Zodiac {aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces};
Zodiac selection;

if (month==3&&day>=21 || month==4&&day<20)
zodiac = 0;
else if(month==4&&day>=21 || month==5&&day<=21)
zodiac = 1;
else if(month==5&&day>=22 || month==6&&day<=21)
zodiac = 2;
else if(month==6&&day>=22 || month==7&&day<=22)
zodiac = 3;
else if(month==7&&day>=23 || month==8&&day<=21)
zodiac = 4;
else if(month==8&&day>=22 || month==9&&day<=23)
zodiac = 5;
else if(month==9&&day>=24 || month==10&&day<=23)
zodiac = 6;
else if(month==10&&day>=24 || month==11&&day<=22)
zodiac = 7;
else if(month==11&&day>=23 || month==12&&day<=22)
zodiac = 8;
else if(month==12&&day>=23 || month==1&&day<=20)
zodiac = 9;
else if(month==1&&day>=21 || month==2&&day<=19)
zodiac = 10;
else if(month==2&&day>=20 || month==2&&day<=20)
zodiac = 11;

switch(zodiac)
{
case 0: Sign = aries; break;
case 1: Sign = taurus; break;
case 2: Sign = gemini; break;
case 3: Sign = cancer; break;
case 4: Sign = leo; break;
case 5: Sign = virgo; break;
case 6: Sign = libra; break;
case 7: Sign = scorpio; break;
case 8: Sign = sagittarius; break;
case 9: Sign = capricorn; break;
case 10: Sign = aquarius; break;
case 11: Sign = pisces; break;
}

selection == Sign;

switch(selection)
{
case aries: cout << " Aries\n"; break;
case taurus: cout << " Taurus\n";break;
case gemini: cout << " Gemini\n"; break;
case cancer: cout << " Cancer\n"; break;
case leo: cout << " Leo\n";break;
case virgo: cout << " Virgo\n"; break;
case libra: cout << " Libra\n"; break;
case scorpio: cout << " Scorpio\n";break;
case sagittarius: cout << " Sagittarius\n"; break;
case capricorn: cout << " Capricorn\n"; break;
case aquarius: cout << " Aquarius\n";break;
case pisces: cout << " Pisces\n"; break;
}
Aries Horoscope - Aries Astrology
Are you an Aries and are looking for a way to always get your readings done for free? Then this is the exact place to be. Here you will learn the best way to get your Aries free horoscope.
Among all the twelve zodiacs, this is the first one. It represents commencement of all things and also the desire to lead. This zodiac is very energetic, adventurous, pioneer and very courageous. There are many more traits that come with Arians which all make them stand out well from the rest. This is one of the reasons they tend to look for easy ways to keep in touch with their stars.
Since January it's been a progressive, forward moving phase when new connections were highlighted and you may have given more thought to career, personal standing, reputation or other important matters related to profession. Parents may have been on your mind or others in authority that may have needed careful handling. But overall, this is a sociable and sometimes friendly vibration and so business-type group collaborations are emphasized, also get-togethers of various kinds. A time when the collective energy, the 'one mindedness' is amplified and there is more scope for the unexpected or unconventional. Plunging into a social circle for work or play will be productive and expand your awareness and some of you will be making new friends or other types of useful contacts. Keep your feet on the ground on the 16th and let your intuition be your guide, on the 20th, 21st when you may have to read between the lines or be a bit secretive for a good reason.

Taking into consideration that you might be a very busy person, you might find it difficult always having your star sign read for you. There is however another way you can go about this whole situation. One good way to have your stars read is by using Aries free horoscope websites.
These star signs assist you in many areas of your life. The most common areas are of course family, love and finances. These are the areas which many people have most problems with and will get the best readings on this and know how to go about solving any of the problems.
There are many websites that offer Aries free horoscope and finding one is the easiest of tasks. Most of these sites are operated by experienced astrologists who are always more than willing to give you good readings for free any time you want.
The alternative would be to go physically to an astrologist who of course doesn't give their services for free. You will spend money and time looking for one and driving to their location. The internet gives you an easier alternative whereby all you have to do is login into one of the many websites there are out there from the comfort of your home. You will also get the readings done really quickly with just a click of a button.
The same websites that give you these readings will give you other services that will make the whole situation better. Some of these services included telling you your love matches and how other zodiacs would work with you, if you were to get into a relationship with them. You will also get beginner courses on how you can start depending on the stars if you are new to the whole thing.
These horoscopes are the exact thing you need to keep you motivated and making informed decisions without having to spend a dime on the service. Those who are currently using these kinds of services can openly talk of how they have helped them on their day to day activities and how they are now more focused with the way they run their lives. You too can be one of those people who are enjoying these services.
http://www.omastrology.com/zodiacsigns/aries-horoscope.php
Topic archived. No new replies allowed.