viraco4a

Untitled

Jan 20th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1.  
  2. namespace Radoslava
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. string InputLine = Console.ReadLine();
  9. List<Svaliach> AllSvaliachiNaRadoslava = new List<Svaliach>();
  10. while (InputLine != "end")
  11. {
  12. Svaliach NewSvaliach = GetNewSvaliach(InputLine);
  13.  
  14.  
  15.  
  16. InputLine = Console.ReadLine();
  17. }
  18. }
  19.  
  20. private static Svaliach GetNewSvaliach(string InputLine)
  21. {
  22. string[] splittedInput = InputLine.Split(' ').ToArray();
  23. Svaliach NewSvaliach = new Svaliach();
  24. NewSvaliach.Name = splittedInput[0];
  25. NewSvaliach.LevelOfSexinessFrom1To10 = int.Parse(splittedInput[1]);
  26. NewSvaliach.Coolnessfrom1To10 = int.Parse(splittedInput[2]);
  27. NewSvaliach.IQ = double.Parse(splittedInput[3]);
  28. if (splittedInput[4] == "yes")
  29. {
  30. NewSvaliach.IsSmoker = true;
  31. }
  32. else
  33. {
  34. NewSvaliach.IsSmoker = false;
  35. }
  36.  
  37. NewSvaliach.PrivateLifeStatuss = splittedInput[5];
  38. return NewSvaliach;
  39. }
  40. }
  41.  
  42. public class Svaliach
  43. {
  44. public string Name { get; set; }
  45. public int LevelOfSexinessFrom1To10 { get; set; }
  46. public int Coolnessfrom1To10 { get; set; }
  47. public double IQ { get; set; }
  48. public bool IsSmoker { get; set; }
  49. public string PrivateLifeStatuss { get; set; }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment