Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine("Введите количество занятий");
  8. string zanyatiya = Console.ReadLine();
  9. int kolvoZanyatiy = Convert.ToInt32(zanyatiya);
  10.  
  11. int[] mas = new int[kolvoZanyatiy];
  12. int[] mas1 = new int[kolvoZanyatiy];
  13. int i = 0;
  14. string test;
  15. string test1;
  16. int count = 0;
  17. double kolvoElementov = 0;
  18. double kolvoElementov1 = 0;
  19. Console.WriteLine("Введите оценки ");
  20. do {
  21. test = Console.ReadLine();
  22. if (test == "end") break;
  23. mas[i] = Convert.ToInt32(test);
  24. ++i;++count;++kolvoElementov;
  25. } while (true);
  26. double sum = 0;
  27.  
  28. for (int j = 0; j < count; j++) {
  29. sum = sum + mas[j];
  30. }
  31.  
  32. Console.WriteLine("Все оценки");
  33. for (int j = 0; j < count; j++) {
  34. Console.Write(mas[j] + " ");
  35. }
  36. Console.WriteLine();
  37.  
  38. i = 0;
  39. count = 0;
  40. Console.WriteLine("Введите пропуски с помощью единиц ");
  41. do {
  42. test1 = Console.ReadLine();
  43. if (test1 == "end") break;
  44. mas1[i] = Convert.ToInt32(test1);
  45. ++i; ++count;++kolvoElementov1;
  46. } while (true);
  47. Console.WriteLine("Количество пропусков");
  48. double sum1 = 0;
  49. for (int j = 0; j < count; j++) {
  50. sum1 += mas1[j];
  51. }
  52. Console.Write(sum1);
  53. Console.WriteLine();
  54. double sredOcenka = 0;
  55. double sredN = 0;
  56. sredOcenka = (sum/kolvoElementov);
  57. sredN = (sum1/kolvoZanyatiy*100);
  58. double poseshyaemost = 100 - sredN;
  59.  
  60. Console.WriteLine("Средняя оценка ");
  61. Console.WriteLine(sredOcenka);
  62. Console.WriteLine("Процентное соотношение пропусков" );
  63. Console.WriteLine(sredN);
  64. Console.WriteLine("Посещяемость" );
  65. Console.WriteLine(poseshyaemost);
  66.  
  67. if ((sredOcenka == 3) && (poseshyaemost >= 90)) {
  68. Console.WriteLine("Зачет");
  69. }
  70. else {
  71. if ((sredOcenka == 4) && (poseshyaemost >= 85)) {
  72. Console.WriteLine("Зачет");
  73. }
  74. else {
  75. if ((sredOcenka == 5) && (poseshyaemost >= 75)) {
  76. Console.WriteLine("Зачет");
  77. }
  78. else {
  79. Console.WriteLine("Незачет");
  80. }
  81.  
  82. }
  83. }
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement