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 =
PayPal Gateway not configured
PayPal Gateway not configured