User interaction
At least 1 user-defined class (must instantiate object from class)
Contain all logic structures – sequence, selection and repetition
Read from or write to an external file
Operator overloading
Data-validation
At least one array (one-dimensional)
#include <iostream>
#include <string>
using namespace std;
int main ()
{
/* declare variables*/
int date;
string month;
char goagain;
do
{
/* ask user for birth date information*/
cout << " Please press return after entering your information." << endl;
cout << "What is your birth date? Enter a month first, followed by date. " << endl;
cin >> month >> date;
/*beginning of 'if' statement
that determines your zodiac sign and then
displays the results to the screen*/
if ((month == "march" && date > 21) || (month == "april" && date < 19))
cout << " You are Aries! Adventurous and energetic." << endl;
else if ((month == "april" && date > 20 ) || (month == "may" && date < 20))
cout << "You are Taurus!Patient and reliable." << endl;
if (month == "march" && date == 21)
{ cout << " You are Aries! Adventurous and energetic. You are on the cusp" <<endl;
cout << " of pisces, who is Imaginative and sensitive." << endl;
}
else if (month == "april" && date == 19)
{ cout << " You are Aries! Adventurous and energetic. You are on the cusp" << endl;
cout <<"of Taurus, Who is Patient and reliable." << endl;
}
if (month == "march" && date == 20)
{ cout << "You are Pisces!Imaginative and sensitive. You are on the cusp" << endl;
cout << "of Aries! Who is Adventurous and energetic." << endl;
}
else if (month == "april" && date == 20)
{ cout << "You are Taurus!Patient and reliable. You are on the cusp " << endl;
cout << "of Aries! Who is Adventurous and energetic." << endl;
}
if ((month == "may" && date > 21) || (month == "june" && date < 22))
cout << "You are Gemini! Adaptable and versatile." << endl;
else if ((month == "june" && date > 22 ) || (month == "july" && date < 22))
cout << "You are Cancer! Emotional and loving." << endl;
if (month == "may" && date == 21)
{ cout << "You are Gemini! Who is Adaptable and versatile. You are on the cusp" << endl;
cout << "of Taurus, who is Patient and reliable." << endl;
}
else if (month == "june" && date ==22)
{ cout << "You are Cancer! Emotional and loving. You are on the cusp" << endl;
cout << "of Gemini, who is adaptable and versatile." << endl;
}
if (month =="may" && date == 20)
{ cout << "You are Taurus!Patient and reliable. You are on the cusp " << endl;
cout << "of Gemini! Who is Adaptable and versatile." << endl;
}
else if (month == "june" && date ==21)
{ cout << "You are Gemini! Adaptable and versatile.You are on the cusp" << endl;
cout << "of Cancer! Emotional and loving." << endl;
}
if ((month == "july" && date < 22)|| (month == "august" && date < 22))
cout << "You are Leo! Generous and warmhearted." << endl;
else if ((month == "august" && date > 23 ) || (month == "september" && date < 21))
cout << "You are Virgo! Modest and shy." << endl;
if (month == "july" && date == 23)
{ cout << "You are Leo! Generous and warmhearted.You are on the cusp" << endl;
cout << "of Cancer! Emotional and loving." << endl;
}
else if (month == "august" && date == 22)
{ cout << "You are Leo! Generous and warmhearted. You are on the cusp" << endl;
cout << "of Virgo, Who is modest and shy." << endl;
}
if (month == "july" && date == 22)
{ cout << "You are Cancer! Emotional and loving. You are on the cusp" << endl;
cout << "of Leo! Generous and warmhearted." << endl;
}
else if (month == "august" && date == 23)
{ cout << "You are Virgo! Modest and shy.You are on the cusp" << endl;
cout << "of Leo! Generous and warmhearted." << endl;
}
if ((month == "september" && date > 23) || (month == "october" && date < 22))
cout << "You are Libra! Diplomaitic and urbane." << endl;
else if ((month == "october" && date < 22) || (month == "november" && date < 21))
cout << "You are Scorpio! Determined and forceful." << endl;
if (month == "september" && date == 23)
{ cout << "You are Libra! Diplomaitic and urbane. You are on the cusp" << endl;
cout << "of Virgo! who is modest and shy." << endl;
}
else if(month == "october" && date == 22)
{ cout << "You are Libra! Diplomaitic and urbane. You are on the cusp" << endl;
cout << "of Scorpio, Who is determined and forceful." << endl;
}
if(month == "october" && date == 23)
{ cout << "You are Scorpio! Determined and forceful. You are on the cusp" << endl;
cout << "of Libra! Diplomaitic and urbane." << endl;
}
else if (month == "september" && date == 22)
{ cout << "You are Virgo! Modest and shy.You are on the cusp" << endl;
cout << "of Libra! Diplomaitic and urbane." << endl;
}
if ((month == "november" && date < 21) || (month == "december" && date < 22))
cout << "You are Sagittarius! Optimistic and freedom-loving." << endl;
else if ((month == "december" && date > 22) || (month == "january" && date < 19))
cout << "You are Capricorn! Practical and prudent." << endl;
if (month == "november" && date == 22)
{ cout << " You are Sagittarius! Optimistic and freedom-loving. You are on the cusp" << endl;
cout << "of Scorpio, who is determined and forceful" << endl;
}
else if (month == "december" && date == 21)
{ cout << "You are Sagittarius! Optimistic and freedom-loving. You are on the cusp" << endl;
cout << "of Capricorn, who is Practical and prudent" << endl;
}
if (month == "december" && date == 22)
{ cout << "You are Capricorn! Practical and prudent. You are on the cusp" << endl;
cout << "of Sagittarius, who is Optimistic and freedom-loving." << endl;
}
else if (month == "november" && date == 21)
{ cout << "You are Scorpio! Determined and forceful. You are on the cusp" << endl;
cout << "of Sagittarius, who is Optimistic and freedom-loving." << endl;
}
if ((month == "january" && date > 20) || (month == "february" && date < 18))
cout << "You are Aquarius! Friendly and humanitarian." << endl;
else if ((month == "february" && date > 19) || (month == "march" && date < 20))
cout << "You are Pisces! Imaginative and sensitive." << endl;
if (month == "january" && date == 20)
{ cout << "You are Aquarius! Friendly and humanitarian. You are on the cusp" << endl;
cout << "of Capricorn, who is Practical and prudent." << endl;
}
else if (month == "february" && date == 18)
{ cout << "You are Aquarius! Friendly and humanitarian. You are on the cusp" << endl;
cout << "of Pisces who is Imaginative and sensitive" << endl;
}
if (month == "february" && date ==19)
{ cout << "You are Pisces!Imaginative and sensitive. You are on the cusp" << endl;
cout << "of Aquarius, who is Friendly and humanitarian." << endl;
}
else if (month == "january" && date == 19)
{ cout << "You are Capricorn! Practical and prudent. You are on the cusp" << endl;
cout << "of Aquarius, who is Friendly and humanitarian." << endl;
}
/*asks the user if they want to play again*/
cout << "would you like to go again? Please enter y or n" << endl;
cin >> goagain;
/*states that upper or lower case y means go again*/
}while ( goagain =='y' || goagain == 'Y');
system ("pause");
return 0;
}
** Edit **

New Topic/Question
Reply




MultiQuote






|