RE: do this OR that

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Group,
> 
> I have a function that grades a quiz. I want to show a page if the 
> student scores 80% or above.
> 
> Currently, the script reads:
> 
> <snippet>
>    $total = ($mygrade/$quiz->grade) ;
>    if ($total > .80)  {
> </snippet>
> 
> That means that if you score 80% precisely, you don't get the 
> follow-up
> script.
> 
> I believe I should re-write it like this:
> 
> <snippet>				
>    $total = ($mygrade/$quiz->grade) ;
>    if ($total > .80 | .80)  {
> </snippet>
> 
> Is that right? Thanks in advance for your help.
> 

How about this:

<snippet>				
   $total = ($mygrade/$quiz->grade) ;
   if ($total >= .80)  {
</snippet>


or this:

<snippet>				
   $total = ($mygrade/$quiz->grade) ;
   if ($total > .79)  {
</snippet>

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux