Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to round red lipstick to two decimal places and brown lipstick to round three decimal places once calculated. HTML file lab4 Select

I am trying to round red lipstick to two decimal places and brown lipstick to round three decimal places once calculated.

HTML file

lab4

Select lipstick

Red Lipstick, Price: 2.5136 XBT
Brown Lipstick, Price:1.76459 XBT

PHP file

Untitled Document

if(isset($_GET["choice"])){

$lipstick=$_GET["choice"];

$c= count($lipstick);

$price= 0.0;

for($i=0;$i<$c;$i++) {

if($lipstick[$i]==1){

$price=$price+2.5136;

echo "You have selected Red Lipstick ";

}

if($lipstick[$i]==2){

$price=$price+1.76459;

echo "You have selected Brown Lipstick ";

}

}

echo "Final Price is: " .$price. " ";

}

else{

echo "Please choose something!";

}

?>

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_2

Step: 3

blur-text-image_3

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

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago