Exemple #1
0
        private static double determineMarketValue(car car)
        {
            double carValue = 100.0;

            // may go online some day to lookup car's value
            // and retrieve its value into carValue variable
            return(carValue);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            car myNewCar = new car();

            myNewCar.make  = "Ford";
            myNewCar.model = "Expedition";
            myNewCar.year  = 2004;
            myNewCar.color = "Blue";

            Console.WriteLine("{0} - {1} - {2}",
                              myNewCar.make,
                              myNewCar.model,
                              myNewCar.color);

            //double marketValueOfCar = determineMarketValue(myNewCar);
            Console.WriteLine("Car's value: {0:C}", myNewCar.DetermineMarketValue()); // {0:C} return value with a $ symbol
            Console.ReadLine();
        }