Advertisement
silvana1303

exam preparation

May 22nd, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double students = double.Parse(Console.ReadLine());
  10.             int seasons = int.Parse(Console.ReadLine());
  11.             double continuing = 0.0;
  12.  
  13.             for (int i = 1; i <= seasons; i++)
  14.             {
  15.                 double firstExam = Math.Ceiling(students * 0.90);
  16.                 double secondExam = Math.Ceiling(firstExam * 0.90);
  17.                  continuing = Math.Ceiling(secondExam * 0.80);
  18.  
  19.                 if (i % 3 == 0)
  20.                 {
  21.                     continuing += Math.Ceiling(continuing * 0.15);
  22.                 }
  23.                 else
  24.                 {
  25.                     continuing += Math.Ceiling(continuing * 0.05);
  26.                 }
  27.  
  28.                 students = continuing;
  29.             }
  30.  
  31.             Console.WriteLine($"Students: {students}");
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement