Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A1 A2 A3 A4 table { border-spacing: 2em 3em; border-collapse: separate; } td { border-right: solid 1px black; border-left: solid 1px black; } Only output

$a1 = [10.001, 11.591, 0.011, 5.991, 16.121, 0.131, 100.981, 1.001];
$a2 = [1.99, 1.99, 0.99, 1.99, 0.99, 1.99, 0.99, 0.99];
$a3 = [0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01];
$a4 = [10.01, -12.22, 0.23, 19.20, -5.13, 3.12];
function getTotal($arr) {
echo " Processing Array:
" . var_export($arr, true) . "
";
$total = 0.00;
//TODO do adding here
//TODO do rounding stuff here
echo "The total is " . var_export($total, true);
}
echo "Problem 2: Adding Floats ";
?>
A1
A2
A3
A4

Only output the sum/total of the array values by assigning it to the $total variable (the number must end in 2 decimal places, if it ends in 1 it must have a 0 at the end)

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

How many layers are there in the TCP / IP Model?

Answered: 1 week ago

Question

Relational Contexts in Organizations

Answered: 1 week ago