bacco

Външно оценяване; External Evaluation

Feb 5th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Footbal
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double numberStudents = double.Parse(Console.ReadLine());
  10.  
  11.             double poorMark = 0;
  12.             double satisfactoryMark = 0;
  13.             double goodMark = 0;
  14.             double veryGoodMark = 0;
  15.             double excellentMark = 0;
  16.  
  17.             for (int i = 1; i <= numberStudents; i++)
  18.             {
  19.                 double score = double.Parse(Console.ReadLine());
  20.  
  21.                 if (score < 22.5)
  22.                 {
  23.                     poorMark = poorMark + 1;
  24.                 }
  25.                 else if (score >= 22.5 && score < 40.5)
  26.                 {
  27.                     satisfactoryMark = satisfactoryMark + 1;
  28.                 }
  29.                 else if (score >= 40.5 && score < 58.5)
  30.                 {
  31.                     goodMark = goodMark + 1;
  32.                 }
  33.                 else if (score >= 58.5 && score < 76.5)
  34.                 {
  35.                     veryGoodMark = veryGoodMark + 1;
  36.                 }
  37.                 else if (score >= 76.5 && score <= 100)
  38.                 {
  39.                     excellentMark = excellentMark + 1;
  40.                 }
  41.             }
  42.  
  43.             poorMark = poorMark / numberStudents * 100;
  44.             satisfactoryMark = satisfactoryMark / numberStudents * 100;
  45.             goodMark = goodMark / numberStudents * 100;
  46.             veryGoodMark = veryGoodMark / numberStudents * 100;
  47.             excellentMark = excellentMark / numberStudents * 100;
  48.  
  49.             Console.WriteLine($"{poorMark:f2}% poor marks");
  50.             Console.WriteLine($"{satisfactoryMark:f2}% satisfactory marks");
  51.             Console.WriteLine($"{goodMark:f2}% good marks");
  52.             Console.WriteLine($"{veryGoodMark:f2}% very good marks");
  53.             Console.WriteLine($"{excellentMark:f2}% excellent marks");
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment