Exemplo n.º 1
1
        static void addTruck(Garage myGarage)
        {
            string manufacturer = "";
            string model = "";
            int modelYear = 0;
            double initPrice = 0.0;
            int purchaseDate = 0;
            double currentOdometer = 0.0;
            double engineSize = 0.0;

            double cargoCapacity = 0.0;
            double towingCapacity = 0.0;

            getGeneral(ref manufacturer, ref model, ref modelYear, ref initPrice, ref purchaseDate, ref currentOdometer, ref engineSize);

            getTruck(ref cargoCapacity, ref towingCapacity);

            try
            {
                myGarage.Add(manufacturer, model, modelYear, initPrice, purchaseDate, currentOdometer, engineSize, cargoCapacity, towingCapacity);
                Console.WriteLine("\nAdded a small truck\n");
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message + "\n");
            }
        }
Exemplo n.º 2
0
        static void addMoto(Garage myGarage)
        {
            string manufacturer = "";
            string model = "";
            int modelYear = 0;
            double initPrice = 0.0;
            int purchaseDate = 0;
            double currentOdometer = 0.0;
            double engineSize = 0.0;

            string type = "";

            getGeneral(ref manufacturer, ref model, ref modelYear, ref initPrice, ref purchaseDate, ref currentOdometer, ref engineSize);

            getMoto(ref type);

            try
            {
                myGarage.Add(manufacturer, model, modelYear, initPrice, purchaseDate, currentOdometer, engineSize, type);
                Console.WriteLine("\nAdded a motorcycle\n");
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n" + ex.Message + "\n");
            }
        }