Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _07GraduationPt._3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = string.Empty;
- while (true) /*?????*/
- {
- name = Console.ReadLine();
- if (name == "END") /*?????*/
- { break; }
- double sum = 0.0;
- int fault = 0;
- int i = 0;
- for (i = 1; i <= 12; i++)
- {
- if (fault == 2)
- { break; }
- double rate = double.Parse(Console.ReadLine());
- if (fault == 2)
- { break; }
- if (rate < 4 && fault < 2)
- {
- fault++;
- i--;
- }
- else
- {
- sum += rate;
- }
- }
- if (fault == 2)
- {
- Console.WriteLine($"{name} has been excluded at {i} grade");
- }
- else
- {
- Console.WriteLine($"{name} graduated. Average grade: {(sum / 12):f2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement