Skip to content

Instantly share code, notes, and snippets.

@bittersweetryan
Created March 27, 2015 19:23
Show Gist options
  • Save bittersweetryan/97582f9159b0affc5c61 to your computer and use it in GitHub Desktop.
Save bittersweetryan/97582f9159b0affc5c61 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
string getUserInput();
void showPersonality( string );
const string RED = "red";
const string ORANGE = "orange";
const string YELLOW = "yellow";
const string GREEN = "green";
const string BLUE = "blue";
const string PURPLE = "purple";
int main()
{
string color = getUserInput();
showPersonality( color );
}
string getUserInput(){
cout << "What is your favorite color (lower case, please)?" << endl;
string userColor;
cin >> userColor;
return userColor;
}
void showPersonality( string color ){
if( color.compare( RED ) == 0 ){
cout << "Red is the color of fire and blood, so it is associated with energy, war, danger, strength, power, determination as well as passion, desire, and love." << endl;
}
else if( color.compare( ORANGE ) == 0 ){
cout << "Orange combines the energy of red and the happiness of yellow. It is associated with joy, sunshine, and the tropics. Orange represents enthusiasm, fascination, happiness, creativity, determination, attraction, success, encouragement, and stimulation." << endl;
}
else if( color.compare( YELLOW ) == 0 ){
cout << "Yellow is the color of sunshine. It's associated with joy, happiness, intellect, and energy." << endl;
}
else if( color.compare( GREEN ) == 0 ){
cout << "Green is the color of nature. It symbolizes growth, harmony, freshness, and fertility. Green has strong emotional correspondence with safety. Dark green is also commonly associated with money." << endl;
}
else if( color.compare( BLUE ) == 0 ){
cout << "Blue is the color of the sky and sea. It is often associated with depth and stability. It symbolizes trust, loyalty, wisdom, confidence, intelligence, faith, truth, and heaven." << endl;
}
else if( color.compare( PURPLE ) == 0 ){
cout << "Purple combines the stability of blue and the energy of red. Purple is associated with royalty. It symbolizes power, nobility, luxury, and ambition. It conveys wealth and extravagance. Purple is associated with wisdom, dignity, independence, creativity, mystery, and magic." << endl;
}
else{
cout << "You did not chose a color that I reconize, try one of the standard colors of the rainbow." << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment