Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- Console.WriteLine("Введите количество занятий");
- string zanyatiya = Console.ReadLine();
- int kolvoZanyatiy = Convert.ToInt32(zanyatiya);
- int[] mas = new int[kolvoZanyatiy];
- int[] mas1 = new int[kolvoZanyatiy];
- int i = 0;
- string test;
- string test1;
- int count = 0;
- double kolvoElementov = 0;
- double kolvoElementov1 = 0;
- Console.WriteLine("Введите оценки ");
- do {
- test = Console.ReadLine();
- if (test == "end") break;
- mas[i] = Convert.ToInt32(test);
- ++i;++count;++kolvoElementov;
- } while (true);
- double sum = 0;
- for (int j = 0; j < count; j++) {
- sum = sum + mas[j];
- }
- Console.WriteLine("Все оценки");
- for (int j = 0; j < count; j++) {
- Console.Write(mas[j] + " ");
- }
- Console.WriteLine();
- i = 0;
- count = 0;
- Console.WriteLine("Введите пропуски с помощью единиц ");
- do {
- test1 = Console.ReadLine();
- if (test1 == "end") break;
- mas1[i] = Convert.ToInt32(test1);
- ++i; ++count;++kolvoElementov1;
- } while (true);
- Console.WriteLine("Количество пропусков");
- double sum1 = 0;
- for (int j = 0; j < count; j++) {
- sum1 += mas1[j];
- }
- Console.Write(sum1);
- Console.WriteLine();
- double sredOcenka = 0;
- double sredN = 0;
- sredOcenka = (sum/kolvoElementov);
- sredN = (sum1/kolvoZanyatiy*100);
- double poseshyaemost = 100 - sredN;
- Console.WriteLine("Средняя оценка ");
- Console.WriteLine(sredOcenka);
- Console.WriteLine("Процентное соотношение пропусков" );
- Console.WriteLine(sredN);
- Console.WriteLine("Посещяемость" );
- Console.WriteLine(poseshyaemost);
- if ((sredOcenka == 3) && (poseshyaemost >= 90)) {
- Console.WriteLine("Зачет");
- }
- else {
- if ((sredOcenka == 4) && (poseshyaemost >= 85)) {
- Console.WriteLine("Зачет");
- }
- else {
- if ((sredOcenka == 5) && (poseshyaemost >= 75)) {
- Console.WriteLine("Зачет");
- }
- else {
- Console.WriteLine("Незачет");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement