Course Solutions Uncategorized (Solved) : Code Re Write Following Code Segment Using Switch Case Statement Assume Variables Already Q36000297 . . . .

(Solved) : Code Re Write Following Code Segment Using Switch Case Statement Assume Variables Already Q36000297 . . . .

 

Which code is the re-write the following code segment usingswitch-case statement?
We assume that all variables are alreadydefined.
   
    int choice;

    choice = scan.nextInt(); //input the choicenumber and store as integer. 

  
    // Respond to the user’s menu selection.
   
     if (choice == 1)
{

          
cout<<“For how many months? “<<endl;


        months =scan.nextInt();

     
 charges = months * ADULT;


   cout<<“The total charges are $”<<charges<<endl;



    }


     else if (choice == 2)
{

     
 cout<<“For how many months?”<<endl;


   months = scan.nextInt();


   charges = months * CHILD;


   cout<<“The total charges are $”<<charges<<endl;


   }


   else if (choice == 3)
{


   cout<<“For how many months?”<<endl;


   months = scan.nextInt();

     
 charges =

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post