SHARE
TWEET

Untitled

a guest Apr 20th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $juryCount = intval(readline());
  4. $presentationName = " ";
  5. $gradesCount = 0;
  6. $finalAssessment = 0;
  7. $gradeForCurrentPresentation = 0;
  8. $gradesSum = 0;
  9.  
  10. while ($presentationName != "Finish"){
  11.     $presentationName = readline();
  12.     for ($gradesCount = 1; $gradesCount <= $juryCount; $gradesCount++)
  13.     $grade = floatval(readline());
  14.     $gradesSum += $grade;
  15.     $gradesCount++;
  16.     if ($presentationName != "Finish"){
  17.         $gradeForCurrentPresentation = $gradesSum / $gradesCount;
  18.         $finalAssessment += $grade;
  19.         printf ("$presentationName - %0.2f." . PHP_EOL, $gradeForCurrentPresentation);
  20.     } else {
  21.         printf ("Student's final assessment is %0.2f.", $finalAssessment/ $gradesCount);
  22.         break;
  23.     }
  24. }
  25.        
  26.        
  27. //$people = intval(readline());
  28. //$presentationName = " ";      
  29. //$averageGrade = 0;
  30. //$gradeCounter = 0;
  31. //$counter = 0;
  32. //$sumGrade = 0;
  33. //$allGrade = 0;
  34. //
  35. //    for ($gradeCounter = 1; $gradeCounter <= $people; $gradeCounter++) {
  36. //        $grade = floatval(readline());
  37. //        $allGrade += $grade;
  38. //        $sumGrade += $grade;
  39. //        $counter++;
  40. //        if ($gradeCounter == $people) {
  41. //            $averageGrade = $sumGrade / $people;
  42. //            break;
  43. //        }
  44. //        if ($presentationName != "Finish"){
  45. //            printf ("$presentationName - %0.2f." . PHP_EOL, $averageGrade);
  46. //        } else {
  47. //            printf ("Student's final assessment is %0.2f.", $totalGrade);
  48. //        }
  49. //    }
  50. //}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top