Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 and maxYear as
#include
using namespace std;
int main
cout "Please enter your birth year: ;
cin year;
if year && year
break;
cout "The year must be from to please try again!
;
Calculate user's zodiac and write program to display the proper sign
switch year
case :
cout "Your chinese zodiac sign is the rat! endl;
cout "Rats are very popular!" endl;
break;
case :
cout "Your chinese zodiac sign is the ox endl;
cout "Oxes are dependable and calm!" endl;
break;
case :
cout "Your chinese zodiac sign is the tiger! endl;
cout "Tigers are brave and respected!" endl;
break;
case :
cout "Your chinese zodiac sign is the rabbit! endl;
cout "Rabits are nice to be around!" endl;
break;
case :
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 :
cout "Your chinese zodiac sign is the snake! endl;
cout "Snakes are good with money!" endl;
break;
case :
cout "Your chinese zodiac sign is the horse! endl;
cout "Horses are popular, cheerful, and quick to compliment others!" endl;
break;
case :
cout "Your chinese zodiac sign is the goat! endl;
cout "Goats are known for being great artists!" endl;
break;
case :
cout "Your chinese zodiac sign is the monkey! endl;
cout "Monkeys are very funny and good problem solvers!" endl;
break;
case :
cout "Your chinese zodiac sign is the rooster! endl;
cout "Roosters are talented and hard working!" endl;
break;
case :
cout "Your chinese zodiac sign is the dog! endl;
cout "Dogs are very loyal and can keep a secret!" endl;
break;
case :
cout "Your chinese zodiac sign is the pig! endl;
cout "Pigs are good students, honest and brave!" endl;
break;
systempause;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started