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 train_the_trainers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfPeople = int.Parse(Console.ReadLine());
- double allScore = 0;
- double counter = 0;
- while (true)
- {
- string nameOfPresentation = Console.ReadLine();
- double sumOfGrades = 0;
- if (nameOfPresentation=="Finish")
- {
- double scoreSum=allScore/counter;
- Console.WriteLine($"Student's final assessment is {scoreSum:f2}.");
- break;
- }
- for (int i = 0; i < numberOfPeople; i++)
- {
- double grade = double.Parse(Console.ReadLine());
- sumOfGrades += grade;
- allScore += grade;
- counter++;
- }
- double sumAfter = sumOfGrades / numberOfPeople;
- Console.WriteLine($"{nameOfPresentation} - {sumAfter:f2}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement