Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._Exam_Results
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- double points = 0;
- while (name != "Midnight")
- {
- double pointsCounter = 0;
- for (int i = 1; i <= 6; i++)
- {
- points = double.Parse(Console.ReadLine());
- if (points < 0)
- {
- Console.WriteLine($"{name} was cheating!");
- break;
- }
- pointsCounter += points;
- }
- double totalPoints = Math.Floor(pointsCounter / 600 * 100);
- double rate = totalPoints * 0.06;
- if (rate >= 5.00 && points >= 0)
- {
- Console.WriteLine("===================");
- Console.WriteLine("| CERTIFICATE |");
- Console.WriteLine($"| {rate:f2}/6.00 |");
- Console.WriteLine("===================");
- Console.WriteLine($"Issued to {name}");
- }
- else if (rate < 5 && rate >= 3 && points >= 0)
- {
- Console.WriteLine($"{name} - {rate:f2}");
- }
- else if (rate < 3.00 && rate >= 0 && points >= 0)
- {
- Console.WriteLine($"{name} - 2.00");
- }
- name = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment