示例#1
0
        static void Main(string[] args)
        {
            Car myNewCar = new Car();

            myNewCar.Make = "Oldsmobile";
            myNewCar.Model = "Cutlas Supreme";
            myNewCar.Year = 1986;
            myNewCar.Color = "Silver";

            Console.WriteLine("{0} - {1} - {2}",
                myNewCar.Make,
                myNewCar.Model,
                myNewCar.Color);

            //double marketValueOfCar = determineMarketValue(myNewCar);
            Console.WriteLine("Car's value: {0:C}", myNewCar.DetermineMarketValue());
            Console.ReadLine();
        }
示例#2
0
        private static double determineMarketValue(Car car)
        {
            double carValue = 100.0;

            return carValue;
        }