Question: How do I add a while loop to the c + + programming below? Also how do I add a variable so it shows the

How do I add a while loop to the c++ programming below? Also how do I add a variable so it shows the minYear as 1900 and maxYear as 2024?
#include
using namespace std;
int main()
{
cout << "Please enter your birth year: ";
cin >> year;
if (year >=1936 && year <=2055)
break;
cout << "The year must be from 1936 to 2055, please try again!
";
//Calculate user's zodiac and write program to display the proper sign
switch (year%12)
{
case 0:
cout << "Your chinese zodiac sign is the rat! "<< endl;
cout << "Rats are very popular!" << endl;
break;
case 1:
cout << "Your chinese zodiac sign is the ox!"<< endl;
cout << "Oxes are dependable and calm!" << endl;
break;
case 2:
cout << "Your chinese zodiac sign is the tiger! "<< endl;
cout << "Tigers are brave and respected!" << endl;
break;
case 3:
cout << "Your chinese zodiac sign is the rabbit! "<< endl;
cout << "Rabits are nice to be around!" << endl;
break;
case 4:
cout << "Your chinese zodiac sign is the dragon! "<< endl;
cout << "Dragons are known for their good health and having lots of energy!" << endl;
break;
case 5:
cout << "Your chinese zodiac sign is the snake! "<< endl;
cout << "Snakes are good with money!" << endl;
break;
case 6:
cout << "Your chinese zodiac sign is the horse! "<< endl;
cout << "Horses are popular, cheerful, and quick to compliment others!" << endl;
break;
case 7:
cout << "Your chinese zodiac sign is the goat! "<< endl;
cout << "Goats are known for being great artists!" << endl;
break;
case 8:
cout << "Your chinese zodiac sign is the monkey! "<< endl;
cout << "Monkeys are very funny and good problem solvers!" << endl;
break;
case 9:
cout << "Your chinese zodiac sign is the rooster! "<< endl;
cout << "Roosters are talented and hard working!" << endl;
break;
case 10:
cout << "Your chinese zodiac sign is the dog! "<< endl;
cout << "Dogs are very loyal and can keep a secret!" << endl;
break;
case 11:
cout << "Your chinese zodiac sign is the pig! "<< endl;
cout << "Pigs are good students, honest and brave!" << endl;
break;
}
system("pause");
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!