logo

Crowdly

Practical C#/.Net

Looking for Practical C#/.Net test answers and solutions? Browse our comprehensive collection of verified answers for Practical C#/.Net at softserve.academy.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Please, select the output of the code below:

public class PowersOf2     {         static void Main()         {             foreach (int i in Power(2, 5))             {                 Console.Write("{0} ", i);             }         }          public static IEnumerable<int> Power(int number, int exponent)         {             int result = 1;              for (int i = 0; i < exponent; i++)             {                 result = result * number;                 yield return result;             }         }     }

View this question

Please, choose the type that can be used as a return type in the declaration of an iterator with yield:

View this question

Please, choose the members of the IEnumerator<T> interface:

View this question

Please, choose what is true about IEnumerable<T> interface:

View this question

Please, choose what will be the result of the execution of the code below:

interface A     {         void Hello();     }      interface B     {         void Hello();     }      class Test : A, B     {         public void Hello()         {             Console.WriteLine("Hello to all");         }     }     static void Main()     {         Test myTest = new Test();         myTest.Hello();     }

View this question

Please, fill in the gaps. This is the class whose values can be ordered or sorted.

 public class Temperature : <Temperature>

    {

        public int (Temperature other)

        {

            if (other == null) return 1;

            return m_value.CompareTo(other.m_value);

        }

        protected double m_value = 0.0;

        public double Celsius

        {

            get

            {

                return m_value - 273.15;

            }

        }

        public double Kelvin

        {

            get

            {

                return m_value;

            }

            set

            {

                if (value < 0.0)

                {

                    throw new ArgumentException("Temperature cannot be less than absolute zero.");

                }

                else

                {

                    m_value = value;

                }

            }

        }

        public Temperature(double kelvins)

        {

            this.Kelvin = kelvins;

        }

    }
View this question

For the code snippet shown below, which of the following statements are valid?

View this question

Please, choose what will be the result of the execution of the code below:

interface A     {         void Hello();     }      interface B     {         void Hello();     }      class Test : A, B     {         void A.Hello()         {             Console.WriteLine("Hello from A");         }         void B.Hello()         {             Console.WriteLine("Hello from B");         }     }     static void Main()     {         Test myTest = new Test();         ((A)myTest).Hello();     }

View this question

What are the valid constraints on type parameters for

C# generic classes?

0%
View this question

Please, choose what is true about interfaces:

0%
0%
View this question

Want instant access to all verified answers on softserve.academy?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!