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 name = Console.ReadLine();
- double average = 0;
- int marksCount = 1;
- while (marksCount <= 12)
- {
- double input = double.Parse(Console.ReadLine());
- if (input >= 4.00)
- {
- average += input;
- marksCount++;
- }
- }
- average /= 12;
- Console.WriteLine($"{name} graduated. Average grade: {average:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement