Esempio n. 1
0
        static void Main(string[] args)
        {
            // ~~~~~~~~~~~~ Buildings ~~~~~~~~~~~~~
            Building ashwoodModel = new Building("512 8th Avenue");

            ashwoodModel.Width   = 200;
            ashwoodModel.Depth   = 300;
            ashwoodModel.Stories = 13;
            ashwoodModel.Construct();
            ashwoodModel.Purchase("Faith Magras");
            ashwoodModel.Design("Lacey Walker");

            Building pineCrestModel = new Building("P Sherman 42");

            pineCrestModel.Width   = 500;
            pineCrestModel.Depth   = 600;
            pineCrestModel.Stories = 13;
            pineCrestModel.Construct();
            pineCrestModel.Purchase("Leah Robinson");
            pineCrestModel.Design("Andrew Herring");

            Building bloomsdaleModel = new Building("555 Green Acers");

            bloomsdaleModel.Width   = 1200;
            bloomsdaleModel.Depth   = 800;
            bloomsdaleModel.Stories = 13;
            bloomsdaleModel.Construct();
            bloomsdaleModel.Purchase("Chef Gumi");
            bloomsdaleModel.Design("Old Joe");

            // Console.WriteLine($"Address: {ashwoodModel.GetAddress()}");
            // Console.WriteLine("---------------");
            // Console.WriteLine($"Designed by {ashwoodModel.GetDesigners()}");
            // Console.WriteLine($"Constructed on {ashwoodModel.GetDate()}");
            // Console.WriteLine($"Owned by {ashwoodModel.GetOwner()}");
            // Console.WriteLine($"{ashwoodModel.Volume} cubic meters of space");

            ashwoodModel.Buildings();
            pineCrestModel.Buildings();
            bloomsdaleModel.Buildings();

            //~~~~~~~~~~~~ Cities ~~~~~~~~~~~~~
            City megalopolis = new City("Megapolis");

            megalopolis.Mayor("Dolly Parton");

            // foreach(Building building in megalopolis.Buildings)
            // {
            //     Console.WriteLine("...");
            // }

            megalopolis.Cities();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Building FiveOneTwoEighth = new Building("512 8th Ave")
            {
                Width   = 30.25,
                Depth   = 40,
                Stories = 5
            };
            Building TwoFiveOneDekalb = new Building("251 Dekalb Pike")
            {
                Width   = 70.25,
                Depth   = 40,
                Stories = 10
            };
            Building OneFiveTwoNineGreen = new Building("1529 Green St")
            {
                Width   = 25.25,
                Depth   = 30,
                Stories = 3
            };
            Building SixSixThreeFiveMccallum = new Building("6635 Mccallum St")
            {
                Width   = 30.25,
                Depth   = 40,
                Stories = 5
            };

            FiveOneTwoEighth.Construct();
            TwoFiveOneDekalb.Construct();
            OneFiveTwoNineGreen.Construct();
            SixSixThreeFiveMccallum.Construct();

            FiveOneTwoEighth.Purchase("Joe Goldberg");
            TwoFiveOneDekalb.Purchase("Jonathan Simmons");
            OneFiveTwoNineGreen.Purchase("Jon Marks");
            SixSixThreeFiveMccallum.Purchase("Aleshia Hickson");

            List <Building> buildingCollection = new List <Building>()
            {
                FiveOneTwoEighth,
                TwoFiveOneDekalb,
                OneFiveTwoNineGreen,
                SixSixThreeFiveMccallum
            };

            foreach (Building localBuilding in buildingCollection)
            {
                Console.WriteLine(localBuilding.ProvideAddress());
                Console.WriteLine("-----------------------");
                Console.WriteLine($"Designed by {localBuilding.ProvideDesigner()}");
                Console.WriteLine($"Constructed on {localBuilding.ProvideBuildDate()}");
                Console.WriteLine($"Owned by {localBuilding.ProvideOwner()}");
                Console.WriteLine($"{localBuilding.Volume} cubic meters of space");
                Console.WriteLine();
            }

            City Philadelphia = new City("Philadelphia", "Pennsylvania");

            Philadelphia.Mayor("Jim Kenney");
            Philadelphia.YearEstablished(1682);
            Philadelphia.AddBuilding(FiveOneTwoEighth);
            Philadelphia.AddBuilding(TwoFiveOneDekalb);
            Philadelphia.AddBuilding(OneFiveTwoNineGreen);
            Philadelphia.AddBuilding(SixSixThreeFiveMccallum);

            Console.WriteLine("New City");
            Console.WriteLine($"{Philadelphia.Name}, {Philadelphia.State}");
            Console.WriteLine($"Year Established: {Philadelphia.ProvideYearEstablished()}");
            Console.WriteLine($"Current Mayor: {Philadelphia.ProvideMayor()}");
            Console.WriteLine($"Buildings:");
            foreach (Building cityBuilding in Philadelphia.Buildings)
            {
                Console.WriteLine(cityBuilding.ProvideAddress());
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Building FiveOneTwoEighth = new Building("512 8th Avenue")
            {
                Stories = 24,
                Width   = 30,
                Depth   = 20
            };

            FiveOneTwoEighth.Construct();
            FiveOneTwoEighth.Purchase("Steve Jobs");

            Building PinnacleTower = new Building("123 4th Ave South")
            {
                Stories = 36,
                Width   = 40,
                Depth   = 40
            };

            PinnacleTower.Construct();
            PinnacleTower.Purchase("Donald Trump");

            Building BridgstoneTower = new Building("322 8th Ave South")
            {
                Stories = 46,
                Width   = 60,
                Depth   = 60
            };

            BridgstoneTower.Construct();
            BridgstoneTower.Purchase("John Bridgestone");

            //Create list of buldings in city
            List <Building> buildings = new List <Building>()
            {
                FiveOneTwoEighth, PinnacleTower, BridgstoneTower
            };

            //Create city

            City Brianville = new City("Brianville", 2019);

            Brianville.Mayor("Bill Boner");

            Brianville.newBuilding(FiveOneTwoEighth);
            Brianville.newBuilding(PinnacleTower);
            Brianville.newBuilding(BridgstoneTower);

            //After all of the buildings have been purchased, display the following information to the console for each building.

            foreach (Building building in Brianville.buildingsOfCity)
            {
                Console.WriteLine();
                Console.WriteLine($"Here are the buildings of {Brianville.cityName}:");
                Console.WriteLine();
                Console.WriteLine(building.GetAddress());
                Console.WriteLine("-------------------");
                Console.WriteLine($"Designed by {building.GetDesigner()}.");
                Console.WriteLine($"Constructed on {building.GetDateConstructed()}.");
                Console.WriteLine($"Owned by {building.GetOwner()}");
                Console.WriteLine($"{building.Volume} cubic meters of space.");
                Console.WriteLine();
            }
        }