Advertisement
Guest User

06. Graduation

a guest
May 12th, 2019
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Graduation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             string nameOfStudent = Console.ReadLine();
  11.             double numberOfMark = 1;
  12.             double totalSum = 0.0;
  13.  
  14.             while (numberOfMark <= 12)
  15.             {
  16.                 double mark = double.Parse(Console.ReadLine());
  17.                 totalSum += mark;          
  18.  
  19.                 numberOfMark++;
  20.  
  21.             }
  22.  
  23.             double AverageSum = totalSum / 12;
  24.            
  25.  
  26.             if (totalSum >= 4.00)
  27.             {
  28.                 Console.WriteLine($"{nameOfStudent} graduated. Average grade: {AverageSum:F2}");
  29.             }
  30.                
  31.            
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement