Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Footbal
- {
- class Program
- {
- static void Main(string[] args)
- {
- double numberStudents = double.Parse(Console.ReadLine());
- double poorMark = 0;
- double satisfactoryMark = 0;
- double goodMark = 0;
- double veryGoodMark = 0;
- double excellentMark = 0;
- for (int i = 1; i <= numberStudents; i++)
- {
- double score = double.Parse(Console.ReadLine());
- if (score < 22.5)
- {
- poorMark = poorMark + 1;
- }
- else if (score >= 22.5 && score < 40.5)
- {
- satisfactoryMark = satisfactoryMark + 1;
- }
- else if (score >= 40.5 && score < 58.5)
- {
- goodMark = goodMark + 1;
- }
- else if (score >= 58.5 && score < 76.5)
- {
- veryGoodMark = veryGoodMark + 1;
- }
- else if (score >= 76.5 && score <= 100)
- {
- excellentMark = excellentMark + 1;
- }
- }
- poorMark = poorMark / numberStudents * 100;
- satisfactoryMark = satisfactoryMark / numberStudents * 100;
- goodMark = goodMark / numberStudents * 100;
- veryGoodMark = veryGoodMark / numberStudents * 100;
- excellentMark = excellentMark / numberStudents * 100;
- Console.WriteLine($"{poorMark:f2}% poor marks");
- Console.WriteLine($"{satisfactoryMark:f2}% satisfactory marks");
- Console.WriteLine($"{goodMark:f2}% good marks");
- Console.WriteLine($"{veryGoodMark:f2}% very good marks");
- Console.WriteLine($"{excellentMark:f2}% excellent marks");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment