コード例 #1
0
ファイル: Program.cs プロジェクト: saraashleyhs/CSharpDotNet
        public static void Main(string[] args)
        {
            //Use the Program class that will contain your main method and act as a "driver" for your program.
            //For this assignment you do not have to build an interactive program.(I want to add this in)

            //In your main method:
            //You should instantiate 2 different car lots, and add various vehicles to the car lots.
            CarLot carLot1 = new CarLot("Spirit");
            CarLot carLot2 = new CarLot("Frank Brown");
            Truck  truck1  = new Truck("13A23B", "Ford", "F150", 32500, "Full");
            Car    car1    = new Car("A23B13", "Ford", "Edge", 22000, "Sedan", 4);
            Truck  truck2  = new Truck("C2456B", "Dodge", "Ram", 42500, "Full");
            Car    car2    = new Car("A36C12", "Dodge", "Charger", 27550, "Sedan", 4);

            carLot1.AddVehicle(truck1);
            carLot1.AddVehicle(car1);
            carLot2.AddVehicle(truck2);
            carLot2.AddVehicle(car2);
            carLot1.AddVehicle(new Truck("9LK8F2", "Chevy", "Silverado", 43000, "Half"));

            carLot1.PrintInventory();
            carLot2.PrintInventory();
            //Print out the inventory for each of the car lots, showing the details for each vehicle.
            //When printing out the details, print the appropriate info for a car, or a truck accordingly.
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            //creating the lots
            CarLot lot1 = new CarLot("Ray's Lightly Used Motors");
            CarLot lot2 = new CarLot("Lil' Car Lot");

            //creating car objects to be added
            Truck Truck1 = new Truck("6541B21", "Chevrolet", "Silverado", 49999.00, "4 Door Crew Cab", "Short Bed");
            Truck Truck2 = new Truck("324EL67", "Ford", "F-150", 55599.99, "2 Door Single Cab", "Long Bed");
            Truck Truck3 = new Truck("56H87W1", "Toyota", "Tundra", 40299.99, "3 Door Extended Cab", "Short Bed");
            Truck Truck4 = new Truck("234K3UY", "Jeep", "Patriot", 59900.99, "4 Door Crew Cab", "Standard Bed");
            Truck Truck5 = new Truck("DMW24L6", "Dodge", "Ram", 39999.50, "4 Door Mega Cab", "Long Bed");
            Car   Car1   = new Car("234SD34", "Acura", "RSX-S", 9000.99, "Hatchback", "2 Doors");
            Car   Car2   = new Car("FD452NY", "Mazda", "FD RX-7", 25999.99, "Hatchback", "2 Doors");
            Car   Car3   = new Car("90LOR67", "Subaru", "Impreza WRX", 35000.00, "Sedan", "4 Doors");
            Car   Car4   = new Car("KML238X", "Mitsubishi", "Lancer Evolution X", 28999.99, "Sedan", "4 Doors");
            Car   Car5   = new Car("KLTAN42", "Honda", "Civic", 26998.02, "Sedan", "4 Doors");

            //adding cars to respective lots
            lot1.AddVehicle(Truck1);
            lot2.AddVehicle(Truck2);
            lot1.AddVehicle(Truck3);
            lot2.AddVehicle(Truck4);
            lot1.AddVehicle(Truck5);
            lot2.AddVehicle(Car1);
            lot1.AddVehicle(Car2);
            lot2.AddVehicle(Car3);
            lot1.AddVehicle(Car4);
            lot2.AddVehicle(Car5);

            //calling print lot
            lot1.PrintLot();
            lot2.PrintLot();
        }
コード例 #3
0
        private static void Main(string[] args)
        {
            //Westheimer Imports CarLot
            CarLot Westheimer = new CarLot("Westheimer Imports", new List <Vehicle>());

            Vehicle WCar1 = new Car("Mercedes-Benz", "SL550-AMG", "Coupe", "2", "MBSL550", "$85,000");
            Vehicle WCar2 = new Truck("Ford", "F-150 Raptor", "8ft", "FFR1234", "$78,000");
            Vehicle WCar3 = new Car("Porsche", "Cayenne", "SUV", "4", "2LEG1T", "$46,000");

            //Slick's Slimey Car Sale CarLot
            CarLot Slicks = new CarLot("Slick's Slimey Car Sales", new List <Vehicle>());

            Vehicle Svehicle1 = new Car("Geo", "Metro", "Hatchback", "4", "GB123RD", "$850");
            Vehicle Svehicle2 = new Car("Chrysler", "LeBaron", "Coupe", "2", "1BADR1DE", "$1,000");
            Vehicle Svehicle3 = new Truck("Ford", "Ranger", "4ft", "00PZ4DAT", "$1,200");

            Westheimer.AddVehicle(WCar1);
            Westheimer.AddVehicle(WCar2);
            Westheimer.AddVehicle(WCar3);

            Westheimer.PrintList();

            Slicks.AddVehicle(Svehicle1);
            Slicks.AddVehicle(Svehicle2);
            Slicks.AddVehicle(Svehicle3);

            Slicks.PrintList();

            Console.ReadLine();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            CarLot goodman = new CarLot("Isaac Goodman's Used Cars");                      //Creates a list for the car lots inventory

            goodman.AddVehicle(new Car("ABC 1234", "Chevy", "Camero", 25000, 2, "Coupe")); //adds a new car to the car lot
            goodman.AddVehicle(new Car("ABC 9876", "Dodge", "Challenger", 30000, 2, "Sport"));
            goodman.AddVehicle(new Car("ABC 0258", "Dodge", "Charger", 32000, 4, "Sport"));
            goodman.AddVehicle(new Truck("ABC 8520", "Ford", "F150", 45000, "10 SQ FT."));

            foreach (var car in goodman.GetVehicles())  //Goes through each item in the car lot and prints out the details
            {
                Console.WriteLine(car.PrintDetails());
            }

            CarLot franklyn = new CarLot("Doug Franklyn's Dealership");

            franklyn.AddVehicle(new Car("ZYX 8765", "Toyota", "Camry", 31000, 4, "Sedan"));
            franklyn.AddVehicle(new Car("ZYX 7844", "Toyota", "Corolla", 28000, 4, "Sedan"));
            franklyn.AddVehicle(new Truck("ZYX 1101", "Dodge", "Ranger", 38000, "8.5 SQ FT"));

            foreach (var car in franklyn.GetVehicles())     //goes through each item in the car lot and prints out the details
            {
                Console.WriteLine(car.PrintDetails());
            }
        }
コード例 #5
0
        //Prints out a list of Cars and Trucks
        static void Main(string[] args)
        {
            CarLot newCarLot = new CarLot("Lubbock Car Lot");

            newCarLot.AddVehicle(new Car("W3Z78", "Honda", "Accord", 5000, "Sedan", "4"));
            newCarLot.AddVehicle(new Truck("something333", "Toyota", "Tundra", 7000, "6'3 by 4"));
            newCarLot.AddVehicle(new Car("53", "Volkswagon", "Herbie!", 53000, "Beetle", "2"));

            //loops through the list of vehicles made & actually prints the information
            foreach (var item in newCarLot.StoreVehicles())
            {
                item.PrintInformation();
            }
            Console.ReadLine();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            CarLot carlotNarly = new CarLot("\tNARLY'S AUTOS", "We have the Gnarliest Rides in Town so come on down!\n\n\tNARLY'S Inventory:");
            CarLot carlotBurly = new CarLot("\tBURLY'S AUTOS", "Wow, What a Beaut!\n\n\tBURLY'S Inventory:");

            carlotNarly.AddVehicle(new Truck(1972, "Chevy", "C10", 15999.99, "CEEYA", "Single Cab", "6ft"));

            carlotNarly.AddVehicle(new Truck(1996, "Chevy", "1500", 10999.99, "ROLLIN", "Crew Cab", "6ft"));

            carlotNarly.AddVehicle(new Truck(2018, "Chevy", "Colorado", 50999.99, "2SLOW", "Full Cab", "6ft"));


            carlotBurly.AddVehicle(new Car(2019, "Chevy", "Cruise LT", 15999.99, "YEEHAW", "Hatchback", 4));

            carlotBurly.AddVehicle(new Car(2006, "Infiniti", "G35", 35999.99, "BETSY", "Coupe", 2));

            carlotBurly.AddVehicle(new Car(1969, "Chevy", "Camaro", 45999.99, "WBR", "Coupe", 2));


            carlotNarly.CarLotCommercial();
            Console.WriteLine($"{carlotNarly.vehicles.Count} Gnarly Rides");
            Console.WriteLine();


            foreach (var automobile in carlotNarly.GetVehicles())
            {
                automobile.VehicleDescription();
            }


            Console.WriteLine("Or Press any key to find a sweet ride at our other location:\n");
            Console.ReadKey();


            carlotBurly.CarLotCommercial();
            Console.WriteLine($"{carlotBurly.vehicles.Count} Beauts!");
            Console.WriteLine();


            foreach (var automobile in carlotBurly.GetVehicles())
            {
                automobile.VehicleDescription();
            }

            Console.WriteLine("Did you find one you love? Press any key to exit the program. Don't forget to come sign the paperwork to get yourself rollin'!");
            Console.ReadKey();
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: ericcoker18/CSharpProjects
        static void Main(string[] args)
        {
            CarLot Carlot1 = new CarLot("Honda");
            CarLot Carlot2 = new CarLot("Pollard Ford");
            Truck  truck1  = new Truck("Large", 54847, "Ford", "Mustang", 30000);
            Truck  truck2  = new Truck("Small", 48792, "Chevy", "Corvette", 60000);
            Car    Car1    = new Car("Sedan", 4, 977468, "Dodge", "Dart", 50000);
            Car    Car2    = new Car("Suv", 4, 484648, "Suburu", "CrossTrek", 27000);

            Carlot1.AddVehicle(truck1);
            Carlot1.AddVehicle(Car1);
            Carlot2.AddVehicle(truck2);
            Carlot2.AddVehicle(Car2);

            Carlot1.PrintVehicle();
            Carlot2.PrintVehicle();
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: Ajreyna/CSharp.net
        //Main as used here implements the classes and methods for the rest of the program
        public static void Main(string[] args)
        {
            Console.WriteLine("What is the name of the car lot?");
            string response1 = Console.ReadLine();

            //CarLot cars = new CarLot(response1);
            Console.WriteLine("The name of this carlot is {0}. \n \n", response1);
            Console.WriteLine("The inventory of this carlot includes");
            CarLot cars = new CarLot(response1);


            cars.AddVehicle(new Car("Coupe", 2, "1234566", "ford", "mustang", 25000));
            cars.AddVehicle(new Car(CarType: "Sedan", NumOfDoors: 4, licenseNumber: "AVB33KXR", Make: "Chrysler", Model: "New Yorker Brougham", Price: 10000));
            cars.AddVehicle(new Truck(licenseNumber: "WTF190XRF", Make: "Chevrolet", Model: "Silverado", Price: 90000, BedSize: "Long Bed"));

            cars.PrintVehicles();
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: jbardell19/csharp
        static void Main(string[] args)
        {
            CarLot  LotA   = new CarLot("JB Andrew Lot");
            CarLot  LotB   = new CarLot("Kelly Blue Book Lot");
            Vehicle car1   = new Car("GHY546", "Honda", "Civic", 24000.50, "hatchback", 4);
            Vehicle car2   = new Car("KHV848", "Kia", "Civic", 19000.80, "coupe", 4);
            Vehicle truck1 = new Truck("ghys564", "Ford", "F150", 40000.5, "short");
            Vehicle truck2 = new Truck("ghys564", "Toyota", "Tundra", 50000.5, "Standard");

            LotA.AddVehicle(car1);
            LotA.AddVehicle(car2);
            LotA.AddVehicle(truck1);
            LotB.AddVehicle(truck2);
            LotA.PrintInventory();
            LotB.PrintInventory();
            Console.ReadKey();
        }
コード例 #10
0
        static void Main(string[] args)
        {
            CarLot  LotA   = new CarLot("Smith Ford Lot");
            CarLot  LotB   = new CarLot("Annie Oakley Lot");
            Vehicle car1   = new Car("GHY546", "Honda", "Civic", 24000.50, "hatchback", 4);
            Vehicle car2   = new Car("KHV848", "kia", "Civic", 19000.80, "coupe", 4);
            Vehicle truck1 = new Truck("ghys564", "ford", "f150", 40000.5, "short");
            Vehicle truck2 = new Truck("ghys564", "GMC", "Canyon", 50000.5, "Standard");

            LotA.AddVehicle(car1);
            LotA.AddVehicle(car2);
            LotA.AddVehicle(truck1);
            LotB.AddVehicle(truck2);

            LotA.PrintInventory();
            LotB.PrintInventory();

            Console.ReadKey();
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: kemora08/Csharp
        public static void Main(string[] args)
        {
            Console.WriteLine("Name");
            NameInput = Console.ReadLine();
            Console.WriteLine("A list of Vehicles.");
            ListVehiclesInput = Console.ReadLine();
            Console.WriteLine("Add a vehicle to the lot.");
            string VehiclesInput = Console.ReadLine();

            Console.WriteLine("Print the inventory of the car, including number of vehicles and details about each vehicle.");
            VehiclesInput = Console.ReadLine();

            Console.WriteLine("Type in a vehicle type.");
            Console.WriteLine("Is the car a vehicle? Yes or No");

            CarLot carLot1 = new CarLot("Mora Rentals", new List <Vehicle>());

            Vehicle Dodge  = new Car("Sport", 2, "Dodge", "Charger", "$40,000", "123ABC");
            Vehicle Toyota = new Truck("Toyota", "10ft", "THEA233", "Tacoma");
            Vehicle Ford   = new Car("Coupe", 30, "Ford", "Taurus", "$45,450", "ERA125");

            carLot1.AddVehicle(Dodge);
            carLot1.AddVehicle(Toyota);
            carLot1.AddVehicle(Ford);

            carLot1.PrintCarLot();
            Console.ReadLine();

            CarLot carLot2 = new CarLot("Garcia's Used Cars", new List <Vehicle>());

            Vehicle Car1 = new Car("SUV", 4, "Dodge", "Journey", "$50,000", "ERH456");
            Vehicle Car2 = new Truck("Ford", "15ft", "$60,456", "IJKL230", "F150");

            carLot2.AddVehicle(Car1);
            carLot2.AddVehicle(Car2);

            carLot2.PrintCarLot();
            Console.ReadLine();
        }
コード例 #12
0
        static void Main(string[] args)
        {
            CarLot lot1 = new CarLot();
            CarLot lot2 = new CarLot();

            lot1.Name = "McGavock";
            lot2.Name = "Frank Brown";
            lot1.AddVehicle(new Car {
                LicenseNumber = "12345", Make = "Nissan", Model = "New", Price = 12000
            });
            lot1.AddVehicle(new Truck {
                LicenseNumber = "23456", Make = "Ford", Model = "old", Price = 30000
            });
            lot2.AddVehicle(new Car {
                LicenseNumber = "54321", Make = "VW", Model = "New", Price = 13000
            });
            lot2.AddVehicle(new Truck {
                LicenseNumber = "23476", Make = "Chevy", Model = "New", Price = 40000
            });
            lot1.PrintInventory();
            lot2.PrintInventory();
            Console.ReadLine();
        }
コード例 #13
0
ファイル: Program.cs プロジェクト: antrp93LCA/LCA_221-Csharp
        private static void Main(string[] args)
        {
            //Instantiation of Reagor CarLot
            CarLot Reagor = new CarLot("Reagor", new List <Vehicle>());

            //Instantiation of vehicles to be later added to Reagor CarLot
            Vehicle Rvehicle1 = new Car("Ford", "Mustang", "Coup", "2", "GTG123", "$34,000");
            Vehicle Rvehicle2 = new Truck("Ford", "F-150", "5ft", "WMN4567", "$50,000");
            Vehicle Rvehicle3 = new Car("Mazda", "Tribute", "SUV", "4", "HUY9876", "$12,000");

            //Instantiation of Tony's Used Cars CarLot
            CarLot TonyUsed = new CarLot("Tony's Used Cars", new List <Vehicle>());

            //Vehicles to go into Tony's Used Cars
            Vehicle Tvehicle1 = new Car("Ford", "Fusion", "Sedan", "4", "FFS4356", "$70,000");
            Vehicle Tvehicle2 = new Car("Tesla", "Model S", "Luxury Sedan", "4", "EEF6798", "$150,000");
            Vehicle Tvehicle3 = new Truck("Chevrolet", "Silverado", "10ft", "OOP2019", "$77,000");

            //Adding Vehicles to the Lot List
            Reagor.AddVehicle(Rvehicle1);
            Reagor.AddVehicle(Rvehicle2);
            Reagor.AddVehicle(Rvehicle3);

            //Printing the list
            Reagor.PrintList();

            //Adding Vehicles to Tony's Lot
            TonyUsed.AddVehicle(Tvehicle1);
            TonyUsed.AddVehicle(Tvehicle2);
            TonyUsed.AddVehicle(Tvehicle3);

            //Printing the lot list
            TonyUsed.PrintList();

            Console.ReadLine();
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: devannea/CSharpDotNET
        static void Main(string[] args) // "driver" for program
        {
            // instantiate 2 different car lots, and add various vehicles to the car lots
            // print out the inventory for each of the car lots, showing the details for each vehicle
            // print the appropriate info for a car, or a truck accordingly
            CarLot CarLot1 = new CarLot();

            CarLot1.Name = "Toyota";

            Truck Truck1 = new Truck();

            Truck1.LicenseNumber = "ABC-DEFG";
            Truck1.Make          = "Toyota";
            Truck1.Model         = "Tundra";
            Truck1.Price         = "$30,000";
            Truck1.BedSize       = "Long";

            CarLot1.AddVehicle(Truck1);

            Car Car1 = new Car();

            Car1.LicenseNumber = "123-4567";
            Car1.Make          = "Toyota";
            Car1.Model         = "Camry";
            Car1.Price         = "$23,000";
            Car1.Type          = "SE";
            Car1.NumberOfDoors = 4;

            CarLot1.AddVehicle(Car1);

            Car Car2 = new Car();

            Car2.LicenseNumber = "EFG-4567";
            Car2.Make          = "Toyota";
            Car2.Model         = "4Runner";
            Car2.Price         = "$31,000";
            Car2.Type          = "Premium";
            Car2.NumberOfDoors = 4;

            CarLot1.AddVehicle(Car2);

            CarLot1.PrintInventory();

            CarLot CarLot2 = new CarLot();

            CarLot2.Name = "Ford";

            Truck Truck2 = new Truck();

            Truck2.LicenseNumber = "ABC-1234";
            Truck2.Make          = "Ford";
            Truck2.Model         = "F-150";
            Truck2.Price         = "$28,000";
            Truck2.BedSize       = "Standard";

            CarLot2.AddVehicle(Truck2);

            Truck Truck3 = new Truck();

            Truck3.LicenseNumber = "123-ABCD";
            Truck3.Make          = "Ford";
            Truck3.Model         = "Ranger";
            Truck3.Price         = "$24,000";
            Truck3.BedSize       = "Standard";

            CarLot2.AddVehicle(Truck3);

            Car Car3 = new Car();

            Car3.LicenseNumber = "EFG-4567";
            Car3.Make          = "Ford";
            Car3.Model         = "Fushion";
            Car3.Price         = "$22,000";
            Car3.Type          = "SE";
            Car3.NumberOfDoors = 4;

            CarLot2.AddVehicle(Car3);

            CarLot2.PrintInventory();
        }