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 ConsoleApplication22
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- double grades = 1;
- double sum = 0;
- double counter = 0;
- while (grades <= 12)
- {
- double grade = double.Parse(Console.ReadLine());
- if (grade >= 4.00)
- {
- sum = sum + grade;
- grades++;
- }
- else
- {
- counter = counter + 1;
- if (counter == 2) break;
- }
- }
- if(counter==2)
- {
- Console.WriteLine("{0} has been excluded at {1} grade", name, grades);
- }
- else
- {
- double srednaOcenka = sum / 12;
- Console.WriteLine("{0} graduated. Average grade: {1:f2}", name, srednaOcenka);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement