NedyalkoKikov

ExamResultV2

May 16th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ExamResultV2
  8. {
  9. class ExamResultV2
  10. {
  11. static void Main()
  12. {
  13. Dictionary<string, List<double>> resultFromExam = new Dictionary<string, List<double>>();
  14. resultFromExam["Jackson"] = new List<double>() { 5.2555, 3.25, 5.50 };
  15. resultFromExam["Krstina"] = new List<double>() { 7.5, 6.7, 8,0 };
  16. foreach(var r in resultFromExam)
  17. {
  18. var personName = r.Key;
  19. List<string> result = new List<string>();
  20. var marks = r.Value;
  21. foreach(var mark in marks)
  22. {
  23.  
  24. result.Add(string.Format("{0:F2}", mark));
  25. }
  26. var marksForPrint = string.Join(", ", result);
  27. Console.WriteLine("{0} - - {1}",personName,marksForPrint);
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment