Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace schoolEnd
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- int count = 0;
- double sum = 0.0;
- double average = 0.0;
- while (true)
- {
- double num = double.Parse(Console.ReadLine());
- sum = sum + num;
- count++;
- if (count == 12)
- {
- average = sum / count;
- if (average > 4 && average<= 6)
- {
- Console.WriteLine($"{name} graduated. Average grade: {average:f2}");
- break;
- }
- else if ( average <4)
- {
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement