Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Graduation
- {
- class Program
- {
- static void Main(string[] args)
- {
- string studentName = Console.ReadLine();
- int count = 0;
- double yearGrade = 0.0;
- int end = 0;
- while (count < 12)
- {
- double grade = double.Parse(Console.ReadLine());
- if (grade >= 4.0)
- {
- yearGrade += grade;
- count++;
- }
- else if (grade < 4)
- {
- end++;
- if (end > 1)
- {
- count++;
- Console.WriteLine($"{studentName} has been excluded at {count} grade");
- break;
- }
- }
- }
- double finalGrade = yearGrade / 12;
- if (finalGrade >= 4.00 || count==12 )
- {
- Console.WriteLine($"{studentName} graduated. Average grade: {finalGrade:f2} ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement