Professional Documents
Culture Documents
Program Code
Program Code
#include <iostream>
#include<windows.h>
using namespace std;
int main( ){
int month,date;
int colour;
cout<<"______________Birthday
Game____________\n\n\n";
//input
do{
cout<<"Enter your birth month = ";
cin>>month;
if((month>=1)&&(month<=12))
break;
else
cout<<"Invalid Input..."<<endl;
}while(1);
do{
cout<<"Enter your birth date = ";
cin>>date;
if(month==2) //used to tackle february month
problem
{
if((date>=1)&&(date<=29))
break;
else
cout<<"Invalid Input..."<<endl;
}
else
if((month==1)||(month==3)||(month==5)||(month==7)||(
month==8)||(month==10)||(month==12))
{
if((date>=1)&&(date<=31))
break;
else
cout<<"Invalid Input..."<<endl;
}
else
{
if((date>=1)&&(date<=30))
break;
else
cout<<"Invalid Input..."<<endl;
}
}
while(1);
cout<<"\n\nColour"<<"===="<<"Code"<<endl
<<"\nWhite\t=0"<<endl
<<"Black\t=1"<<endl
<<"Brown\t=2"<<endl
<<"Pink\t=3"<<endl
<<"Red\t=4"<<endl
<<"Blue\t=5"<<endl
<<"Green\t=6"<<endl
<<"Purple\t=7"<<endl
<<"Grey\t=8"<<endl
<<"Yellow\t=9"<<endl
<<"Orange\t=10"<<endl
<<"Other\t=11"<<endl;
do{
cout<<"\n\nEnter the code of your shirt's colour
that you are wearing now = ";
cin>>colour;
if((colour>=0)&&(colour<=11))
break;
else
cout<<"Invalid Input";
} while(1);