0

Can all of u help me?
I can not solve this:
<DOCTYPE html>
<html<!>
<head>
</head>
<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
2 Years
Discussion Span
Last Post by Aeonix
0

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.

0
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:.....
   Grade:.....
   Regard,
   Fongsiev

Edited by Fongsiev

0

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.