In the C++ program below, replace as many conditional statements as possible in the 12 Days Of Christmas song with one or more arrays. #include #include #include using namespace std; int main() {...


In the C++ program below, replace as many conditional statements as possible in the 12 Days Of Christmas song with one or more arrays.



#include


#include


#include


using namespace std;



int main()


{


       for (int day = 1; day <= 12;="">


       {


              cout < "on="" the="">


              switch (day)


              {


              case 1:


                     cout <>


                     break;


              case 2:


                     cout <>


                     break;


              case 3:


                     cout <>


                     break;


              case 4:


                     cout <>


                     break;


              case 5:


                     cout <>


                     break;


              case 6:


                     cout <>


                     break;


              case 7:


                     cout <>


                     break;


              case 8:


                     cout <>


                     break;


              case 9:


                     cout <>


                     break;


              case 10:


                     cout <>


                     break;


              case 11:


                     cout <>


                     break;


              default:


                     cout <>


              }


              cout < "="" of="" day="" of="" christmas"=""><>


              cout < "my="" true="" love="" sent="" to="" me:"=""><>



              for (int gift = day; gift >= 1; --gift)


                     switch (gift)


                     {


                     case 1:


                           if (day == 1)


                                  cout < "a="" partridge="" in="" a="" pear="" tree"=""><>


                           else


                                  cout < "and="" a="" partridge="" in="" a="" pear="" tree"=""><>


                           break;


                     case 2:


                           cout < "2="" turtle="" doves,"=""><>


                           break;


                     case 3:


                           cout < "3="" french="" hens,"=""><>


                           break;


                     case 4:


                           cout < "4="" calling="" birds,="" "=""><>


                           break;


                     case 5:


                           cout < "5="" golden="" rings,"=""><>


                           break;


                     case 6:


                           cout < "6="" geese="" a="" laying,"=""><>


                           break;


                     case 7:


                           cout < "7="" swans="" a="" swimming,"=""><>


                           break;


                     case 8:


                           cout < "8="" maids="" a="" milking,"=""><>


                           break;


                     case 9:


                           cout < "9="" ladies="" dancing,"=""><>


                           break;


                     case 10:


                           cout < "10="" lords="" a="" leaping,"=""><>


                           break;


                     case 11:


                           cout < "11="" pipers="" piping,"=""><>


                           break;


                     default:


                           cout < "12="" drummers="" drumming,"=""><>


                     }


              cout <>


       }


       system("pause");


       return 0;


}

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here