1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#include <iostream>
using namespace std;
void main()
{
char color, solid, length;
cout<<"Please answer the questions with the first character of the word response, (ex: 't' or 'T' for tan, 'l' or 'L' for long, etc.).\n";
cout<<"What is the fur length of the cat? (l, s, m)";
cin>>length;
if (length=='l')
else if (length=='L')
{
cout<<"What is the major color of the cat? (t, b, o) ";
cin>>color;
switch (color){
case 't':
case 'T': cout<<"This cat is named Twinkie.";
break;
case 'o':
case 'O': cout<<"This cat is named Cornelius.";
break;
}
else if (length=='s')
else if (length=='S')
{
cout<<"What is the major color of the cat? (t, b, o) ";
cin>>color;
switch (color){
case 't':
case 'T': cout<<"This cat is named Princess.";
break;
case 'o':
case 'O': cout<<"This cat is named Dudley.";
break;
case 'b':
case 'B': cout<<"Is this cat a solid color? (y/n)";
cin>>color;
if (color=='y')
else if (color=='Y') cout<<"This cat is named Nicodemus.";
break;
else if (color=='n')
else if (color=='N') cout<<"This cat is named Jimmy.";
break;
}
else if (length=='m')
else if (length=='M')
{
cout<<"What is the major color of the cat? (b, o, t)";
cin>>color;
switch (color){
case 'b':
case 'B': cout<<"This cat is named Panther.";
break;
case 'o':
case 'O': cout<<"This cat is named Ivan.";
break;
case 't':
case 'T': cout<<"Is this cat a solid color? (y/n)";
cin>>color;
if (color=='y')
else if (color=='Y'){
cout<<"This cat is named Priss";
break;
else cout<<"This cat is named Bucky";
}
}
}
|