Thursday, August 15, 2013

Condominium Conditions(allows dogs)

#include <iostream>
#include <string>
using namespace std;

int main()

{
 //declare variables





 string dogName;
 string userSName;
 string dogSBreed;
 int gotDog;
 int limitSize=30;
 double dogSSize;

 //profesor remember the loop just work for user choice 1 or 2, and i m going to comment it just if you want to prove it undo that, thanks.
 //do
 //{
 //input user's name and save it into a variable.
 cout<<'\n';
 cout<<'\t'<<'\t'<<'\t'<<"Please, enter your name:"<<endl;
 getline(cin,userSName);
 cout<<endl;

 //declaration statement.
   cout<<'\t'<<'\t'<<'\t'<<"Do you own a dog at the present time?"<<'\n';
   cout<<'\t'<<'\t'<<"1.If you own one."<<'\n';
   cout<<'\t'<<'\t'<<"2.If you don't own one."<<endl;


   //enter validation for user choice.

   cin>>gotDog;
   cout<<endl;
   //declare condition for user choice.
   if (gotDog>2||gotDog<1)
   
    //display error message for bad input.
   { cout<<'\t'<<'\t'<<'\t'<<"Bad Choice Selection!!!!"<<'\n';
     cout<<'\t'<<'\t'<<"  "<<"Please your choice must be 1 or 2."<<endl;
   }
   //declare condition for user choice.
   else if (gotDog==2)
  //display acceptance message.
   cout<<'\t'<<'\t'<<'\t'<<"Congratulation!!!!"<<'\n'<<
 '\t'<<'\t'<<"Welcome to our condominum:"<<" "<<userSName<<endl;

   else
   {






    {
    cout<<'\t'<<'\t'<<'\t'<<"Please enter your dog's breed:"<<endl;
       cin>>dogSBreed;
    cout<<endl;
    }
    //declare condition for dog 's breed.
     if (dogSBreed=="pit-bull")
  //display condition message
  cout<<'\t'<<'\t'<<"Sorry, but you aren't welcome in the condominum"<<'\n'<<
  '\t'<<'\t'<<"since pitbulls are illigal in Miami Dade County."<<endl;
     else
 
     {

     {
     //declare input dog size.
     cout<<'\t'<<'\t'<<'\t'<<"Please enter the size of your dog:"<<endl;
     cin>>dogSSize;
     cout<<endl;
     }

 
     //declare condition for dog size
     if(dogSSize>limitSize)
    
    {
     //display condition message for dog's size
     cout<<'\t'<<'\t'<<'\t'<<"Sorry but your dog exceeds the limit"<<'\n';
     cout<<'\t'<<'\t'<<'\t'<<"size for the tenants rules. "<<endl;
     }
     else

   {
    //input dog's name.
   cout<<'\t'<<'\t'<<'\t'<<"What 's your dog name:"<<'\n';
   cin>>dogName;
      cout<<endl;
   //display user's name and dog's name.
   cout<<'\t'<<'\t'<<'\t'<<"Wellcome to our condominium:"<<'\n'<<
    '\t'<<'\t'<<'\t'<<userSName<<" "<<"and"<<"  "<<dogName<<endl;
     }





     }  
   }
    //erase the system and does loop
 //system("cls");
 //}
 //while(gotDog==1|| gotDog==2);

 system("pause");
 return 0;


}

No comments:

Post a Comment