Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Net;
  6. using System.Net.Mail;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace ConsoleApplication
  11. {
  12. class reccompany
  13. {
  14. string name;
  15. string address;
  16. string owner;
  17. performer per= new performer();
  18. public reccompany(string n, string a, string o,performer p)
  19. {
  20.  
  21. per.name = p.name;
  22. per.nickname = p.nickname;
  23. name = n;
  24. address = a;
  25. owner = o;
  26. }
  27. public void show()
  28. {
  29.  
  30. Console.WriteLine("Name :"+name);
  31. Console.WriteLine("adress :"+address);
  32. Console.WriteLine("owner :"+owner);
  33. Console.WriteLine("performer :"+per.name);
  34. Console.WriteLine("perfomer nick : "+per.nickname);
  35. per.albinfo();
  36. per.slist();
  37. }
  38. }
  39.  
  40. class performer
  41. {
  42. public string name;
  43. public string nickname;
  44.  
  45. albums alb = new albums();
  46.  
  47. public performer()
  48. {
  49.  
  50. name = "";
  51. nickname = "";
  52.  
  53. }
  54. public performer(string na, string nick,albums al)
  55. {
  56. alb.name = al.name;
  57. alb.genre = al.genre;
  58. alb.yearofcreation = al.yearofcreation;
  59. alb.numberofsoldcopies = al.numberofsoldcopies;
  60. name = na;
  61. nickname = nick;
  62. }
  63. public void albinfo()
  64. {
  65. Console.WriteLine("album name : "+alb.name);
  66. Console.WriteLine("genere : "+alb.genre);
  67. Console.WriteLine("year of cre : "+alb.yearofcreation);
  68. Console.WriteLine("copies sold : "+alb.numberofsoldcopies);
  69. }
  70. public void slist()
  71. {
  72. for (int i = 0; i < alb.s.Count; i++)
  73. {
  74. alb.s[i].showsong();
  75. }
  76. }
  77. }
  78.  
  79. class albums
  80. {
  81. public string name;
  82. public string genre;
  83. public string yearofcreation;
  84. public string numberofsoldcopies;
  85. public List<songs> s = new List<songs>();
  86.  
  87. public albums()
  88. {
  89. name = "";
  90. genre = "";
  91. yearofcreation = "";
  92. numberofsoldcopies = "";
  93. }
  94. public albums(string nam, string gen,string ye,string cop)
  95. {
  96. name = nam;
  97. genre = gen;
  98. yearofcreation = ye;
  99. numberofsoldcopies = cop;
  100.  
  101. s.Add(new songs{name="song name 1",duration="1 hour"});
  102. s.Add(new songs { name = "song name 2", duration = "1.5 hour" });
  103. }
  104.  
  105. }
  106. class songs
  107. {
  108. public string name;
  109. public string duration;
  110.  
  111. public void showsong()
  112. {
  113. Console.WriteLine("song name : "+name);
  114. Console.WriteLine("song duration : "+duration);
  115. }
  116. }
  117.  
  118. class Program
  119. {
  120. static void Main(string[] args)
  121. {
  122. albums ob = new albums("new album", "american", "2019", "1000");
  123. performer ob1 = new performer("mickel", "mic",ob);
  124. reccompany obj = new reccompany("phonix", "usa", "someone", ob1);
  125. obj.show();
  126.  
  127. }
  128. }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement