コード例 #1
0
        static void Main(string[] args)
        {
            //Car Car1 = new Car("Honda", "Civic", 1998);
            //Car Car2 = new Car();

            //Console.WriteLine(Car1.GetInfo());
            //Console.WriteLine(Car2.GetInfo());

            //Car2.Make = "Ford";
            //Car2.Model = "Taurus";

            //Car1.Honk();

            //Console.WriteLine(Car2.GetInfo());

            Student Pat = new Student("Pat", "McClary", 1337);

            Pat.Courses.Add(new Course("Professional Development", "A"));
            Pat.Courses.Add(new Course("Intro to Business", "C"));
            Pat.Courses.Add(new Course("Being Rad", "B"));
            Pat.Courses.Add(new Course("Intro to Programming", "D"));
            Pat.Courses.Add(new Course("Hockey 101", "A"));
            Pat.PrintInfo();

            Console.ReadKey(); //Keep the console open
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //Car Car1 = new Car("Honda", "Civic", 1998);
            //Car Car2 = new Car();

            //Console.WriteLine(Car1.GetInfo());
            //Console.WriteLine(Car2.GetInfo());

            //Car2.Make = "Ford";
            //Car2.Model = "Taurus";

            //Car1.Honk();

            //Console.WriteLine(Car2.GetInfo());

            Student Pat = new Student("Pat", "McClary", 1337);
            Pat.Courses.Add(new Course("Professional Development", "A"));
            Pat.Courses.Add(new Course("Intro to Business", "C"));
            Pat.Courses.Add(new Course("Being Rad", "B"));
            Pat.Courses.Add(new Course("Intro to Programming", "D"));
            Pat.Courses.Add(new Course("Hockey 101", "A"));
            Pat.PrintInfo();

            Console.ReadKey(); //Keep the console open
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Car myCar = new Car("BMW", "Ix8");
            Car car   = new Car();

            Console.WriteLine(myCar.GetInfo());
            Console.WriteLine(car.GetInfo());
            myCar.Honk();
            Student Trai = new Student(1001, "Trai", "Wren");

            // add a course
            Trai.Courses.Add(new Course("Professional Development", "A"));
            Trai.Courses.Add(new Course("Futbol Class", "B"));
            Trai.Courses.Add(new Course("SoftWare Devlopment", "C"));
            Trai.Courses.Add(new Course("English", "A"));
            Trai.Courses.Add(new Course("Calculus", "D"));
            Trai.PrintInfo();


            Console.ReadKey();
        }