Named Constants

The goal for this exercise is for you to understand what a (named) constant is, and how to use it.

What you need to do to prepare for this exercise:


What you need to do for this exercise
  1. You must watch and understand the online video that accompanies this exercise.

  2. There is no required work that you need to turn in for this exercise.

In case you find it useful, here's a copy of the source code that was used in the video:

using System;
namespace ConsoleApplication1
{
    class ComputerScreen
    {
        public const double WIDTH = 10.5;
        public const double HEIGHT = 14.0;
    }
    class Program
    {
        public const int NUM_TRIES = 5;
        // NAMED CONSTANT
        static void Main(string[] args)
        {
            Console.WriteLine("The width of the screen is {0}", ComputerScreen.WIDTH);
            Console.WriteLine("The height of the screen is {0}", ComputerScreen.HEIGHT);
        }
    }
}