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 _02.Graduation
- {
- class Program
- {
- static void Main(string[] args)
- {
- string Name = Console.ReadLine();
- double grades = 1;
- double sum = 0;
- while (grades <= 12)
- {
- double grade = double.Parse(Console.ReadLine());
- if (grade >= 4.00)
- {
- sum = sum + grade;
- grades++;
- }
- }
- double average = sum / 12;
- Console.WriteLine($"{Name} graduated. Average grade: {average:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement