fk4m1913

Untitled

May 10th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.60 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ExamPoints
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             // Input task count
  10.             // Input points
  11.             // Input module
  12.             // Calculate result
  13.             // Print output
  14.  
  15.             int taskCount = int.Parse(Console.ReadLine());
  16.             int points = int.Parse(Console.ReadLine());
  17.             string module = Console.ReadLine();
  18.  
  19.             double result = 0;
  20.  
  21.             switch (module)
  22.             {
  23.                 case "Basics":
  24.                     switch (taskCount)
  25.                     {
  26.                         case 1:
  27.                             result = 8;
  28.                             break;
  29.                         case 2:
  30.                             result = 9;
  31.                             break;
  32.                         case 3:
  33.                             result = 9;
  34.                             break;
  35.                         case 4:
  36.                             result = 10;
  37.                             break;
  38.                     }
  39.                     break;
  40.  
  41.                 case "Fundamentals":
  42.                     switch (taskCount)
  43.                     {
  44.                         case 1:
  45.                             result = 11;
  46.                             break;
  47.                         case 2:
  48.                             result = 11;
  49.                             break;
  50.                         case 3:
  51.                             result = 12;
  52.                             break;
  53.                         case 4:
  54.                             result = 13;
  55.                             break;
  56.                     }
  57.                     break;
  58.  
  59.                 case "Advanced":
  60.                     switch (taskCount)
  61.                     {
  62.                         case 1:
  63.                             result = 14;
  64.                             break;
  65.                         case 2:
  66.                             result = 14;
  67.                             break;
  68.                         case 3:
  69.                             result = 15;
  70.                             break;
  71.                         case 4:
  72.                             result = 16;
  73.                             break;
  74.                     }
  75.                     break;
  76.             }
  77.  
  78.             result *= points;
  79.  
  80.             if (module == "Advanced")
  81.             {
  82.                 result *= 1.2;
  83.             }
  84.  
  85.             else if (module == "Basics" && taskCount == 1)
  86.             {
  87.                 result *= 0.8;
  88.             }
  89.  
  90.             Console.WriteLine($"Total points: {result / 100:f2}");
  91.         }
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment