Advertisement
Niicksana

External Evaluation

Dec 3rd, 2017
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace External_Evaluation
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double n = double.Parse(Console.ReadLine());
  14.  
  15.             int poor = 0;
  16.             int satisfactory = 0;
  17.             int good = 0;
  18.             int verygood = 0;
  19.             int exellence = 0;
  20.  
  21.             for (int grade = 1; grade <= n; grade++)
  22.             {
  23.                 double points = double.Parse(Console.ReadLine());
  24.  
  25.                 if (points < 22.5)
  26.                 {
  27.                     poor++;
  28.                 }
  29.  
  30.                 else if (points >= 22.5 && points < 40.5 )
  31.                 {
  32.                     satisfactory++;
  33.                 }
  34.                 else if (points >= 40.5 && points < 58.5)
  35.                 {
  36.                     good++;
  37.                 }
  38.                 else if (points >= 58.5 && points < 76.5)
  39.                 {
  40.                     verygood++;
  41.                 }
  42.                 else if (points >= 76.5 && points <= 100)
  43.                 {
  44.                     exellence++;
  45.                 }
  46.  
  47.                
  48.             }
  49.  
  50.             double Poor = (poor  * 100.0) / n;
  51.             double Satisfactory = (satisfactory * 100.0) / n;
  52.             double Good = (good * 100.0) / n;
  53.             double Verygood = (verygood * 100.0) / n;
  54.             double Exellence = (exellence * 100.0) / n;
  55.  
  56.             Console.WriteLine("{0:f2}% poor marks", Poor);
  57.             Console.WriteLine("{0:f2}% satisfactory marks", Satisfactory);
  58.             Console.WriteLine("{0:f2}% good marks", Good);
  59.             Console.WriteLine("{0:f2}% very good marks", Verygood);
  60.             Console.WriteLine("{0:f2}% excellent marks", Exellence);
  61.         }
  62.  
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement