Description Write a program that determines a user\'s personality type from know
ID: 3561441 • Letter: D
Question
Description Write a program that determines a user's personality type from knowing the user's favorite color. The program displays a menu of a list of colors with a number associated with each color. The program asks the user to select his/her favorite color from the list by entering the number next to it's favorite as below: 1-My favorite color is Red 2 -My favorite color is Green 3- My favorite color is Blue 4 -My favorite color is Violet Select your favorite color from the list by entering the number next to it: After the user makes its selection, the program determines the user's personality type from user's favorite color as below: Favorite Color Personality Type Red Feeling Type Green Thinking Type Blue Intuitive Type Violet Sensing TypeExplanation / Answer
program C++ using CASE STATEMENT As Your Requirement:
#include <iostream>
using namespace std;
int main()
{
int fav_col_num=0;
cout<<"Enter Your Favourite Color "<<endl<<endl;
cout<<"********************************************"<<endl;
cout<<"1. My Favourite Color is Red"<<endl;
cout<<"2. My Favourite Color is Green"<<endl;
cout<<"3. My Favourite Color is Blue"<<endl;
cout<<"4. My Favourite Color is Vilote"<<endl;
cout<<"********************************************"<<endl;
cin>>fav_col_num;
switch(fav_col_num)
{
case 1:
cout<<"Feeling Type";
break;
case 2:
cout<<"Thinking Type";
break;
case 3:
cout<<"Intuitive Type";
break;
case 4:
cout<<"Sensing Type";
break;
default:
cout<<"Select Correct Color";
}
return 0;
}
Output:-