Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Murach's PHP And MYSQL (2nd Edition) Only need 4-6 and 7-9 Change the code that determines the discount percent 3. Change the if statement so

Murach's PHP And MYSQL (2nd Edition)

image text in transcribedOnly need 4-6 and 7-9 image text in transcribed

Change the code that determines the discount percent 3. Change the if statement so customers of type R with a subtotal that's greater than or equal to $250 but less than $500 get a 25% discount and those with a subtotal of $500 or more get a 30% discount. Next, change the if statement so customers of type C always get a 20% discount. Then, test these changes. 4. Add another type to the if statement so customers of type T get a 40% discount for subtotals of less than $500, and a 50% discount for subtotals of $500 or more. Also, make sure that customer types that aren't R, C, or T get a 10% discount. Then, test these changes. 5. Test the application again, but use lowercase letters for the customer types. Note that these letters aren't evaluated as capital letters. 6. Modify the code so the users can enter either capital or lowercase letters for the customer types. To do that, use logical operators. Then, test this change. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Supply Chain Finance Solutions

Authors: Erik Hofmann, Oliver Belin

1st Edition

3642175651, 978-3642175657

More Books

Students also viewed these Finance questions