Exemple #1
0
        static void Main(string[] args)
        {
            DriverLicense license01 = new DriverLicense();

            license01.FirstName     = "Gray";
            license01.LastName      = "Sanders";
            license01.Gender        = "Male";
            license01.LicenseNumber = 15789458;

            Book book01 = new Book();

            book01.Title     = "The History of C#";
            book01.Author    = new string[2];
            book01.Author[0] = "Gray Sanders";
            book01.Author[1] = "Clara Sanders";
            book01.Pages     = 178;
            book01.SKU       = "FG345SGV2353";
            book01.Publisher = "Sanders Inc";
            book01.Price     = 19.99;

            Airplane airplane01 = new Airplane();

            airplane01.Manufacturer = "Boeing";
            airplane01.Model        = "DC7";
            airplane01.Variant      = "X4";
            airplane01.Capacity     = 250;
            airplane01.Engines      = 2;

            Console.WriteLine(license01.Display());
            Console.WriteLine(book01.Display());
            Console.WriteLine(airplane01.Display());
            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            DriverLicense firstLicense = new DriverLicense("Jared", "Bardell", "Male", 71990583);

            Console.WriteLine("Hello, my name is {0} {1}, and I am a {2}. My driver's license number is: {3}",
                              firstLicense.firstName, firstLicense.lastName, firstLicense.gender, firstLicense.licenseNumber);
            firstLicense.GetFullName();
            Console.ReadKey();
        }
Exemple #3
0
        static void Main(string[] args)
        {   //Driver's License Instance
            DriverLicense driver1  = new DriverLicense("Joe", "Schmoe", "Male", "12345555");
            string        FullName = driver1.GetFullName();

            Console.WriteLine(FullName);

            //Book Instance
            Book   book1   = new Book("The Greasy Gatsby", "Melvin Feinstein", "Molly Ringwold", "710", "58756-120", "Barnes & Noble Press", "$24.95");
            string Authors = book1.GetAuthors();

            Console.WriteLine(Authors);

            //Plane Instance
            Airplane airplane1 = new Airplane("Boeing", "Stealth Bomber", "Variant 6", "Variant 3", "2", "3");

            Console.WriteLine("The {0} {1} {2},{3}, holds {4} passengers and has {5} engines!", airplane1.Manufacturer, airplane1.Model, airplane1.Variant1, airplane1.Variant2, airplane1.Capacity, airplane1.Engines);
            string Variants = airplane1.GetVariants();

            Console.WriteLine(Variants);
        }
        static void Main(string[] args)
        {
            DriverLicense Example1 = new DriverLicense("Jason", "Blue", "M", 123456);
            DriverLicense Example2 = new DriverLicense("Jane", "Doe", "F", 567890);
            DriverLicense Example3 = new DriverLicense("Joe", "Smith", "M", 987654);

            //Print DriverLicense class examples
            Console.WriteLine("Driver License: " + "\n");
            Console.WriteLine("License#: {0} | Gender: {1} | {2}",
                              Example1.LicenseNumber, Example1.Gender, Example1.FullName);
            Console.WriteLine("License#: {0} | Gender: {1} | {2}",
                              Example2.LicenseNumber, Example2.Gender, Example2.FullName);
            Console.WriteLine("License#: {0} | Gender: {1} | {2}",
                              Example3.LicenseNumber, Example3.Gender, Example3.FullName);
            Book Book1 = new Book("The Great Gatsby", "F.Scott Fitzgerald", 180, 0743273567, "Scribner", 9.89);
            Book Book2 = new Book("Moby Dick", "Herman Melville", 378, 1503280780, "CreateSpace", 12.11);
            Book Book3 = new Book("Of Mice and Men", "John Steinbeck", 107, 0140177396, "Penguin Books", 9.22);

            //Print Book class examples
            Console.WriteLine("\n" + "Books: " + "\n");
            Console.WriteLine("Title: {0} | Author: {1} | Pages: {2} \nSku: {3}          | Publisher: {4}        | Price: ${5}",
                              Book1.Title, Book1.Authors, Book1.Pages, Book1.Sku, Book1.Publisher, Book1.Price);
            Console.WriteLine("\n" + "Title: {0}        | Author: {1}    | Pages: {2} \nSku: {3}         | Publisher: {4}     | Price: ${5}",
                              Book2.Title, Book2.Authors, Book2.Pages, Book2.Sku, Book2.Publisher, Book2.Price);
            Console.WriteLine("\nTitle: {0}  | Author: {1}     | Pages: {2} \nSku: {3}          | Publisher: {4}   | Price: ${5}",
                              Book3.Title, Book3.Authors, Book3.Pages, Book3.Sku, Book3.Publisher, Book3.Price);
            Airplane Plane1 = new Airplane("Boeing", "747", "400", 416, 4);
            Airplane Plane2 = new Airplane("Airbus", "A340", "300", 290, 4);
            Airplane Plane3 = new Airplane("Embraer", "190", "E-Jet", 98, 2);

            //Print Airplane class examples
            Console.WriteLine("\n" + "Airplanes: " + "\n");
            Console.WriteLine("Manufacturer: {0} \nModel: {1} \nVariant: {2} \nCapacity: {3} \nEngines: {4}",
                              Plane1.Manufacturer, Plane1.Model, Plane1.Variant, Plane1.Capacity, Plane1.Engines);
            Console.WriteLine("\nManufacturer: {0} \nModel: {1} \nVariant: {2} \nCapacity: {3} \nEngines: {4}",
                              Plane2.Manufacturer, Plane2.Model, Plane2.Variant, Plane2.Capacity, Plane2.Engines);
            Console.WriteLine("\nManufacturer: {0} \nModel: {1} \nVariant: {2} \nCapacity: {3} \nEngines: {4}",
                              Plane3.Manufacturer, Plane3.Model, Plane3.Variant, Plane3.Capacity, Plane3.Engines);
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            //Driver License Instance
            DriverLicense Driver1  = new DriverLicense("Kevin", "Mora", "Male", "27606268");
            string        FullName = Driver1.GetFullName();

            Console.WriteLine(FullName);



            //Book Instance
            Book Book1 = new Book(1, "Harry Potter", "J.K. Rowling", "Publisher", "500", "400", "$19.99");
            Book Book2 = new Book(2, "LOTR", "J.R.R Tolkien", "Publisher", "1000", "12345", "$100,000");
            Book Book3 = new Book(3, "Amelia Bedilia", "Peggy Parish", "Publisher", "340", "320", "$9.96");
            Book Book4 = new Book(4, "Killing of Lincoln", "Bill O; Reilly", "Martin Dugard", "Publisher", "400", "$32.99");



            //Plane Instance
            Airplane Plane1 = new Airplane(1, "Boeing", "Model-1", "Variant 5", "40", "3");
            Airplane Plane2 = new Airplane(2, "Airbus", "Model-2", "Variant 3", "32", "12");
            Airplane Plane3 = new Airplane(3, "Bombardier", "Model-3", "Variant 4", "45", "13");
            Airplane Plane4 = new Airplane(4, "Cirrus Aircraft", "Model-IO-550-N", "Variant 10", "30", "65");
        }
 public static void Main(string[] args)
 //this is where the objects are called
 {
     DriverLicense Jaimee = new DriverLicense("Jaimee", "Herrera", "F", 012345, 10 );
 }