Can all of u help me?
I can not solve this:
<DOCTYPE html>
<html<!>
<body>
<h3>PHP Conditional Operator</h3>
<?php
\$a=100;
\$b=200;
\$c=300;
\$d=500;
\$e=600;
.............................................
how can I do it in order to find the maximize and minimize of this.
Reguard!!!
Fongsiev

3
Contributors
5
Replies
25
Views
3 Years
Discussion Span
Last Post by Aeonix

You mean maximum value and the minimum value?

``````\$a=100;
\$b=200;
\$c=300;
\$d=500;
\$e=600;
echo "The highest value is: " . max(\$a, \$b, \$c, \$d, \$e);
echo "The lowest value is: " . min(\$a, \$b, \$c, \$d, \$e);
``````

But I think it would be better if you just had done this:

``````\$values = array(100, 200, 300, 400, 500, 600);
echo "The highest value is: " . \$max(\$values);
echo "The lowest value is: " . \$min(\$values);
``````

But that's only my opinion. Alternatively, you could put all numbers in numerical array, then use `for(;;) {}` and create process of elimination, where you'd look up if previous number is larger or smaller than the current one.

``````Please help me:
\$Attendence="5pt";
\$Quiz="7pt";
\$Test="5pt";
\$Midterm="15pt";
\$Assignmet="10pt";
\$Final="20pt";
They give me like this.And they want me to Calculate Total score, average, and Grade in php.
like this:
Total Score:....
Average:.....
Regard,
Fongsiev
``````

Edited by Fongsiev

You won't learn anything if I end up making entire homework for you. I provided you the script, the lines of code I provided, if you combine this with, mathematical functions and mathematical operators. You'll find out how to make this work.

This thread is most likely dead as the OP started a new one for some unknown reason

Yea, was just about to send you link to this thread (so you'd have more vision on the situation), then it turned out you are already here.

Edited by Aeonix