Question: index.php file

 index.php file

index.php file

= 100 && $invoice_subtotal = 250 && #invoice_subtotal = 500) { $discount_percent = .3; } } else if ($customer_type == 'C' || $customer_type == 'c') { $discount_percent = .2; } else if ($customer_type == 'T' || $customer_type == 't') { if ($invoice_subtotal 

cases. Use a switch statement with nested if statements to get the same results 7. Code a switch statement right before the if statement. This statement should provide the structure for handling the three cases for customer types: R. C, and T. Then, within each of these cases, you can copy the related code from the if statement below to provide for the discounts that are based on subtotal variations. In other words, you can nest the if statements within the switch 8. Comment out the entire if statement that's above the switch statement. Then. test to make sure the switch statement works correctly. Il you haven't done so already, modify the switch statement so it works for both lowercase and uppercase entries of the three customer types. To do that, use the strtoupper function to convert the customer type to uppercase before it's evaluated. Then, test that change

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!