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.Reflection;
- namespace test
- {
- class Program
- {
- public static void Main()
- {
- string name = Console.ReadLine();
- int clas = 0;
- int failCounter = 0;
- double grades = 0.00;
- while (clas < 12)
- {
- clas++;
- double grade = double.Parse(Console.ReadLine());
- grades += grade;
- if (grade < 4.00)
- {
- failCounter++;
- }
- if (failCounter == 2)
- {
- Console.WriteLine($"{name} has been exluded at {clas - 1} grade");
- break;
- }
- if (clas == 12)
- {
- double averageGrade = grades / 12;
- Console.WriteLine($"{name} graduated. Average grade: {averageGrade:f2}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement