Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Net.Mail;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication
- {
- class reccompany
- {
- string name;
- string address;
- string owner;
- performer per= new performer();
- public reccompany(string n, string a, string o,performer p)
- {
- per.name = p.name;
- per.nickname = p.nickname;
- name = n;
- address = a;
- owner = o;
- }
- public void show()
- {
- Console.WriteLine("Name :"+name);
- Console.WriteLine("adress :"+address);
- Console.WriteLine("owner :"+owner);
- Console.WriteLine("performer :"+per.name);
- Console.WriteLine("perfomer nick : "+per.nickname);
- per.albinfo();
- per.slist();
- }
- }
- class performer
- {
- public string name;
- public string nickname;
- albums alb = new albums();
- public performer()
- {
- name = "";
- nickname = "";
- }
- public performer(string na, string nick,albums al)
- {
- alb.name = al.name;
- alb.genre = al.genre;
- alb.yearofcreation = al.yearofcreation;
- alb.numberofsoldcopies = al.numberofsoldcopies;
- name = na;
- nickname = nick;
- }
- public void albinfo()
- {
- Console.WriteLine("album name : "+alb.name);
- Console.WriteLine("genere : "+alb.genre);
- Console.WriteLine("year of cre : "+alb.yearofcreation);
- Console.WriteLine("copies sold : "+alb.numberofsoldcopies);
- }
- public void slist()
- {
- for (int i = 0; i < alb.s.Count; i++)
- {
- alb.s[i].showsong();
- }
- }
- }
- class albums
- {
- public string name;
- public string genre;
- public string yearofcreation;
- public string numberofsoldcopies;
- public List<songs> s = new List<songs>();
- public albums()
- {
- name = "";
- genre = "";
- yearofcreation = "";
- numberofsoldcopies = "";
- }
- public albums(string nam, string gen,string ye,string cop)
- {
- name = nam;
- genre = gen;
- yearofcreation = ye;
- numberofsoldcopies = cop;
- s.Add(new songs{name="song name 1",duration="1 hour"});
- s.Add(new songs { name = "song name 2", duration = "1.5 hour" });
- }
- }
- class songs
- {
- public string name;
- public string duration;
- public void showsong()
- {
- Console.WriteLine("song name : "+name);
- Console.WriteLine("song duration : "+duration);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- albums ob = new albums("new album", "american", "2019", "1000");
- performer ob1 = new performer("mickel", "mic",ob);
- reccompany obj = new reccompany("phonix", "usa", "someone", ob1);
- obj.show();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement