public void TestMilesToFeet()
        {
            DistanceConverter converter = new DistanceConverter();

            double miles = 1;
            double feet  = converter.MilesToFeet(miles);

            Assert.AreEqual(feet, 5280);
        }
Exemplo n.º 2
0
        public static void Main()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("BNU CO453 Applications Programming 2020-2021!");
            Console.WriteLine();
            Console.Beep();

            Console.WriteLine("1. Distance converter");
            Console.WriteLine("2. BMI Calculator");
            Console.WriteLine("3. Student Grades");
            Console.WriteLine("4. Student Grades");
            Console.WriteLine("5. Student Grades");

            Console.WriteLine(0);

            Console.WriteLine("Select an applocation  ");
            string choice = Console.ReadLine();

            if (choice == "1")
            {
                DistanceConverter converter = new DistanceConverter();
                converter.MilesToFeet();
                converter.MetresToMiles();
                converter.KilometresToMiles();
                converter.MilesToFeet2();
                converter.MetresToMiles2();
                converter.KilometresToMiles2();
                converter.MetresTofeet();
                converter.FeetToMetres();
            }
            else if (choice == "2")
            {
            }
            else if (choice == "3")
            {
                StudentMarks students = new StudentMarks();
                students.Run();
            }
            else if (choice == "4")
            {
                Socialnet social = new Socialnet();
                social.Run();
            }
            else if (choice == "5")
            {
                StudentMarks students = new StudentMarks();
                students.Run();
            }


            // BMI calculator = new BMI();
            // BMI();
            //     Console.ReadLine();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Archive tasks
        /// </summary>
        public void archive()
        {
            //unit 5 task car
            Car car  = new Car();
            Car jazz = new Car();

            jazz.Model = "Jazz";
            Car bmw  = new Car("BMW", "Series 1");
            Car ford = new Car("Ford", "Series 5");

            //TestBook.Test();

            //Task 4.1

            TestDistanceConverter.TestMilesToFeet();
            Console.WriteLine("");
            TestDistanceConverter.TestFeetToMiles();

            DistanceConverter.MilesToFeet(100);

            Console.ReadKey();



            //Ana task
            Console.WriteLine("Hello Ana!");

            //classes are used to create objects. ana is an object which is an instance of the Ana class.
            //i can have ana1 and ana2 that are intances of Ana class
            //Create three new objects from the class:

            //Ana ana = new Ana();
            //Ana ana1 = new Ana();
            //Ana ana2 = new Ana();

            //ana1.WriteTitle("My Wonder Application");
            //ana2.WriteTitle("My Wizard Application");

            //look at the two comments below
            //if it is a static, it can be accessed by using the class instead of object (ana, ana1, ana2)
            //so now I can use the class directly

            // //Ana.WriteTitle("My Wonder Application");

            // //Console.ReadKey();

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }