Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

($SST,0.06); $ totalPurchased =40.30; $2 discount =0; if ($ TotalPurchased $30) else $2 discount =5; echo ($2 discount =2; $> (i) Based on the code

image text in transcribed

($SST,0.06); $ totalPurchased =40.30; $2 discount =0; if ($ TotalPurchased $30) else $2 discount =5; echo ($2 discount =2; $> (i) Based on the code snippet above, examine THREE (3) mistakes made by the author and identify the solution to solve the mistakes. ( 9 marks) (ii) Rewrite the if-else statement above with the ternary operator

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

Students also viewed these Databases questions