<!-- What\'s wrong here? The carsSold array is suppposed to store four values, c
ID: 3734680 • Letter: #
Question
<!--
What's wrong here? The carsSold array is suppposed to store four values, containing the cars sold for each quarter of the year. But when you run the program, there is an error! Are we using the right syntax in our array statements?
<html>
<head>
<title>Car Sales</title>
</head>
<body>
<h1>CAR SALES</h1>
<?php
$carsSold[0][0] = 175;
$carsSold[0][1] = 320;
$carsSold[0][2] = 270;
$carsSold[0][3] = 390;
$totalSales = $carsSold[0] + $carsSold[1] + $carsSold[2] + $carsSold[3];
print("<p>This year we sold $totalSales cars.</p>");
?>
</body>
</html>
<--
Explanation / Answer
//if you have any query then comment below.please rate the answer
<html>
<head>
<title>Car Sales</title>
</head>
<body>
<h1>CAR SALES</h1>
<?php
$carsSold[0] = 175;
$carsSold[1] = 320;
$carsSold[2] = 270;
$carsSold[3] = 390;
$totalSales = $carsSold[0] + $carsSold[1] + $carsSold[2] + $carsSold[3];
print("<p>This year we sold ".$totalSales." cars.</p>");
?>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.