Esempio n. 1
0
        static void Main(string[] args)
        {
            PoliticsTeam politicPost = new PoliticsTeam();

            politicPost.CreateStory();
            politicPost.AddStyle();

            HealthTeam healthPost = new HealthTeam();

            healthPost.CreateStory();
            healthPost.AddStyle();

            GossipTeam gossipPost = new GossipTeam();

            gossipPost.CreateStory();

            Story[] stories = new Story[]
            {
                politicPost.GetStory(),
                    healthPost.GetStory(),
                    gossipPost.GetStory()
            };
            Newspaper sunday = new Newspaper();

            sunday.SetStories(stories);
            sunday.SetPrise(24.99f);

            sunday.Read();
            Console.WriteLine(NewspaperCalculator.CalcNumberOfChars(sunday));
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Story politicStory = new Story("New President", "Kanye West is the new President of the USA", "column");
            Story healthStory  = new Story("Coronavirus", "Coronavirus is defeated", "research paper");
            Story gossipStory  = new Story("Celebrity in Love", "Madonna has a new boyfriend", "review");

            string[] _stories = { "politicStory", "healthStory", "gossipStory" };
            for (int i = 0; i < _stories.Length; i++)
            {
                Console.WriteLine(_stories[i]);
            }


            Newspaper n = new Newspaper();

            float newPrice = 50;

            n.SetPrice(newPrice);
            n.GetPrice();
            n.SetStories(_stories);
            n.GetStories();
            n.Read();
            Console.WriteLine(n);
        }