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 DomashnoGraduation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfInputs = 1;
- double gradeAcumulate = 0.00;
- string name = Console.ReadLine();
- while (numberOfInputs <= 12)
- {
- double grade = double.Parse(Console.ReadLine());
- if (grade >= 4.00)
- {
- gradeAcumulate += grade;
- numberOfInputs++;
- }
- }
- double averageGrade = 1.00 * gradeAcumulate / (numberOfInputs-1);
- Console.WriteLine($"{name} graduated. Average grade: {averageGrade:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement