Пример #1
0
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            Status status1 = new Status("I'm happy");

            //Status status2 = new Status("I think this works!");

            status1.PrintInformation();

            status1.AddOneLike();
            status1.AddOneLike();
            status1.AddOneDislike();
            status1.ReadStatus();

            status1.PrintInformation();

            status1.ReadStatus();
            status1.ReadStatus();

            status1.PrintInformation();


            // The LAST line of code should be ABOVE this line
        }
Пример #2
0
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            // 2.a
            Status myFirstStatus = new Status("This is my first status!");

            //2.b
            Console.WriteLine("{0} has {1} likes and {2} dislikes. It has been read {3} times", myFirstStatus.GetStatusText(), myFirstStatus.GetNoOfLikes(), myFirstStatus.GetNoOfDislikes(), myFirstStatus.GetNumberOfReads());

            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();
            myFirstStatus.AddOneLike();

            myFirstStatus.AddReadCount();
            myFirstStatus.AddReadCount();
            myFirstStatus.AddReadCount();
            myFirstStatus.AddReadCount();
            myFirstStatus.AddReadCount();
            myFirstStatus.AddReadCount();

            myFirstStatus.AddOneDislike();

            Console.WriteLine();
            Console.WriteLine("{0} now has {1} likes and {2} dislikes. It has been read {3} times", myFirstStatus.GetStatusText(), myFirstStatus.GetNoOfLikes(), myFirstStatus.GetNoOfDislikes(), myFirstStatus.GetNumberOfReads());

            myFirstStatus.ReadStatusMultiple(400);

            Console.WriteLine();
            Console.WriteLine("{0} now has {1} likes and {2} dislikes. It has been read {3} times", myFirstStatus.GetStatusText(), myFirstStatus.GetNoOfLikes(), myFirstStatus.GetNoOfDislikes(), myFirstStatus.GetNumberOfReads());
            // The LAST line of code should be ABOVE this line
        }
        public void MyCode()
        {
            // The FIRST line of code should be BELOW this line

            Status status = new Status("I like turtles");

            string _status = status.GetStatusText();

            int _likes = status.GetNoOfLikes();
            int _dislikes = status.GetNoOfDislikes();
            int _numOfReads = status.getNumOfReads();

            Console.WriteLine("Status: " +_status);
            Console.WriteLine("Likes: " + _likes);
            Console.WriteLine("Dislikes: " + _dislikes);
            Console.WriteLine("Read by: " + _numOfReads);

            for (int i = 0; i < 5; i++)
            {
                status.AddOneLike();
            }

            for (int i = 0; i < 2; i++)
            {
                status.AddOneDislike();
            }

            for (int i = 0; i < 10; i++)
            {
                status.ReadStatus();
            }

            _likes = status.GetNoOfLikes();
            _dislikes = status.GetNoOfDislikes();
            _numOfReads = status.getNumOfReads();

            Console.WriteLine(".................");

            Console.WriteLine("Status: " + _status);
            Console.WriteLine("Likes: " + _likes);
            Console.WriteLine("Dislikes: " + _dislikes);
            Console.WriteLine("Read by: " + _numOfReads);

            // The LAST line of code should be ABOVE this line
        }