<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ include '/classes/Calculateur.php'; $calcul = new Calculateur(); $notes = array(); //array_push($notes, 76); //array_push($notes, 78); //array_push($notes, 23); //array_push($notes, 100); try { echo $calcul->calculerMoyenne($notes); } catch (Exception $e) { echo $e->getMessage() . $e->getCode(); }
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ include '/classes/Calculateur.php'; $calculateur = new Calculateur(); $notes = array(); array_push($notes, 98); array_push($notes, 87); array_push($notes, 45); array_push($notes, 100); $notes2 = array(); try { echo $calculateur->calculerMoyenne($notes); echo $calculateur->calculerMoyenne($notes2); } catch (MonException $me) { echo $me; }