Exemplo n.º 1
0
        static void Main(string[] args)
        {
            // creating a new instance of the class
            Car myCar = new Car();

            // getting the properties
            myCar.Make  = "Oldsmobile";
            myCar.Model = "Cutlas Supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";

            // setting the properties
            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            // decimal value = DetermineMarketValue(myCar);
            // turn into currency
            // Console.WriteLine("{0:C}", value);

            // -> $2,000.00
            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //setting the properties
            Car myCar = new Car();

            myCar.Make  = "OldsMobile";
            myCar.Model = "Cutlas Supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";
            //getting the properties
            Console.WriteLine(" {0}, {1}, {2}, {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);
            //Console.Read();

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("The value of myCar is {0:C}", value);
            //Console.ReadLine();


            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
            Console.ReadLine();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Car oneCar = new Car("Chevrolet", "Traverse", 2015, "White");

            Car.MyMethod();

            /*oneCar.Make = "Chevrolet";
             * oneCar.Model = "Traverse";
             * oneCar.Year = 2015;
             * oneCar.Color = "White";*/

            Car twoCar = new Car();   //constructor auto-generated

            //twoCar = oneCar;       //referencing the same memory address
            twoCar.Make  = "Dodge";
            twoCar.Model = "Journey";
            twoCar.Year  = 2014;
            twoCar.Color = "Black";


            Console.WriteLine("Make: " + oneCar.Make + ", Model: " + oneCar.Model);
            Console.WriteLine("Value: {0:C}", oneCar.DetermineMarketValue());

            //decimal value = CalculateMarketValue(oneCar);
            //Console.WriteLine("{0:C}", value);


            oneCar = null;
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            // Initialize an object called Car, and assign this to a variable called 'myNewCar'
            Car myNewCar = new Car();

            // then set the properties of the 'Car' object
            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);

            // this line of code first calls the 'DetermineMarketValue' method that is defined in the 'Car' class...
            // and uses the 'this.Year' to pass in the year of the car (as defined in this instance of the car class)...
            // and then determines the correct market value according to the resutls of the If-Else statement.
            Console.WriteLine("Car's value: {0:C}", myNewCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            // Create new instance of car
            Car myNewCar = new Car();

            // Set properties
            myNewCar.Make   = "Mazda";
            myNewCar.Model  = "3";
            myNewCar.Year   = 2010;
            myNewCar.Colour = "Blue";

            // Get properties
            Console.WriteLine("{0} - {1} - {2} - {3}",
                              myNewCar.Make,
                              myNewCar.Model,
                              myNewCar.Year,
                              myNewCar.Colour);
            // Helper method case:
            // double marketValueOfCar = determineMarketValue(myNewCar);

            // Member method case:
            Console.WriteLine("Car's value: {0:C}", myNewCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Car myNewCar = new Car();

            myNewCar.Make  = "Chevrolet";
            myNewCar.Model = "K10";
            myNewCar.Year  = 1972;
            myNewCar.Color = "Burnt Copper";

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

            Console.WriteLine("Car's Value: {0:C}", myNewCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Audi";
            myCar.Model = "A4";
            myCar.Year  = 2017;
            myCar.Color = "Pink";
            Console.WriteLine("{0} {1} {2} {3}", myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "oldsmobile";
            myCar.Model = "cutlas supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";

            Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Color);
            decimal value = DetermineMarketValueMain(myCar);

            Console.WriteLine("{0:C}", value);
            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Honda";
            myCar.Model = "Japanese";
            myCar.Year  = 1992;
            myCar.Color = "red";

            decimal value = DetermineMarketValue(myCar);

            Console.WriteLine("{0:C}", value);


            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
        }
Exemplo n.º 10
0
        public static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Bugatti";
            myCar.Model = "Migos Level";
            myCar.Year  = 2018;
            myCar.Color = "Navy Blue";
//			Decimal value = DetermineMarketValue (myCar);

            Console.WriteLine("{0} {1} {2} {3}", myCar.Model, myCar.Make,
                              myCar.Year, myCar.Color);

//			Console.WriteLine ("{0:C}", value);
            Console.WriteLine(myCar.DetermineMarketValue());
        }
Exemplo n.º 11
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);

            Console.WriteLine("Car's value: {0:C}", myNewCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 12
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);

            //determineMarketValue(myNewCar);

            double myValue = myNewCar.DetermineMarketValue();

            Console.ReadLine();
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Kia";
            myCar.Model = "Sportage";
            myCar.Year  = 2013;
            myCar.Color = "Silver";

            Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}",value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 14
0
        static void Main(string[] args)
        {
            Car myNewCar = new Car();

            myNewCar.Make  = "Renault";
            myNewCar.Model = "Spider";
            myNewCar.Year  = 1991;
            myNewCar.Color = "Green";

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

            Console.WriteLine("Market Value is: {0:C}",
                              myNewCar.DetermineMarketValue());
            Console.ReadLine();
        }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make   = "Ford";
            myCar.Model  = "Fiesta";
            myCar.Year   = 2017;
            myCar.Colour = "Silver";

            Console.WriteLine($"{myCar.Make}, {myCar.Model}, {myCar.Year}, {myCar.Colour}");

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 16
0
        static void Main(string[] args)
        {
            Car mynewCar = new Car();

            mynewCar.Make  = "Old skul";
            mynewCar.Model = "Cutlas Supreme";
            mynewCar.Year  = 1986;
            mynewCar.color = "silver";

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

            // double marketvalueofCar = DecimalMarketValue(mynewCar);

            Console.WriteLine("Car's value: {0:C}", mynewCar.DetermineMarketValue());


            Console.ReadLine();
        }
Exemplo n.º 17
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Audi";
            myCar.Model = "A3";
            myCar.Year  = 2009;
            myCar.Color = "Dark Green";

            Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}",value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());


            Console.ReadLine();
        }
Exemplo n.º 18
0
        static void Main(string[] args)
        {
            Car myCar = new Car("Oldsmobile", "Cutlas Supreme", 1986, "Silver");  //creating an instance "myCar" of the Car class

            //myCar.Make = "Oldsmobile";        // Video put constructore in Main
            //myCar.Model = "Cutlas Supreme";
            //myCar.Year = 1986;
            //myCar.Color = "Silver";

            Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Color);

            decimal value = myCar.DetermineMarketValue();

            Console.WriteLine("{0:C}", value);

            //Console.ReadKey();

            //Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
        }
Exemplo n.º 19
0
        static void Main(string[] args)
        {
            Car myNewCar = new Car();

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

            myNewCar.Value= myNewCar.DetermineMarketValue(); //setting carvalue with the method

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

            Console.ReadLine();
        }
Exemplo n.º 20
0
        public static void Main(string[] args)
        {
            // create a new instance of the car class - declaring a new car in memory
            Car myCar = new Car();

            myCar.Make   = "Oldsmoblie";
            myCar.Model  = "Cutlas Supreme";
            myCar.Year   = 1986;
            myCar.Colour = "Silver";

            Console.WriteLine("{0} {1} {2} {3}", myCar.Make, myCar.Model, myCar.Year, myCar.Colour);

            // Returns back a value
            //decimal value = DetermineMarketValue (myCar);

            //Console.WriteLine ("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 21
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Honda";
            myCar.Model = "Civic";
            myCar.Year  = 1986;
            myCar.Color = "Red";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            // decimal myValue = DetermineMarketValue(myCar);
            // Console.WriteLine("{0:C}", myValue);
            Console.WriteLine("Market Value: {0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 22
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "Oldsmobile";
            myCar.Model = "Cutlas Supreme";
            myCar.Year = 1986;
            myCar.Color = "Silver";

            Console.WriteLine("{0} {1} {2} {3}",
                myCar.Make,
                myCar.Model,
                myCar.Year,
                myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 23
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Toyota";
            myCar.Model = "Tundra";
            myCar.Year  = 2012;
            myCar.Color = "Black";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("This car is worth {0:C}", value);

            Console.WriteLine("This car is worth {0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 24
0
        static void Main(string[] args)
        {
            Car myNewCar = new Car();

            myNewCar.Make  = "Toyota";
            myNewCar.Model = "4Runner";
            myNewCar.Year  = 1998;
            myNewCar.Color = "Silver";

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

            Console.WriteLine("The market value of the {2} {0} {1} is {3:C}",
                              myNewCar.Make,
                              myNewCar.Model,
                              myNewCar.Year,
                              myNewCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 25
0
        static void Main(string[] args)
        {
            // new command uses the class pattern in memory to be usable by the application
            Car myCar = new Car();

            myCar.Make  = "Oldsmobile";
            myCar.Model = "Cutlass Supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine(value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
            Console.ReadLine();
        }
Exemplo n.º 26
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Ford";
            myCar.Model = "Fusion";
            myCar.Year  = 2000;
            myCar.Color = "Black";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarkedValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 27
0
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "Acura";
            myCar.Model = "Integra Type R";
            myCar.Year  = 2000;
            myCar.Color = "Phoenix Yellow";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 28
0
        static void Main(string[] args)
        {
            //declare new class below.
            Car myCar = new Car();

            myCar.Make  = "Hyundai";
            myCar.Model = "Accent";
            myCar.Year  = 2013;
            myCar.Color = "Desert Blonde";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());


            Car myCar2 = new Car();

            myCar2.Make  = "Pontiac";
            myCar2.Model = "Montana";
            myCar2.Year  = 1989;
            myCar2.Color = "Beige";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar2.Make,
                              myCar2.Model,
                              myCar2.Year,
                              myCar2.Color);
            Console.WriteLine("{0:C}", myCar2.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 29
0
        //creates car object.
        //checks to see age and prints current value/price in £.
        static void Main(string[] args)
        {
            Car myCar = new Car();

            myCar.Make  = "M3";
            myCar.Model = "bmw";
            myCar.Year  = 1999;
            myCar.Color = "Black";

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            decimal value = DetermineMarketValue(myCar);

            Console.WriteLine("{0:C} always 100?", value);

            Console.WriteLine("Current value = {0:c}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 30
0
        public static void Main(string[] args)
        {
            // create new instance of class
            Car myCar = new Car();

            // set properties of class
            myCar.Make  = "Oldsmobile";
            myCar.Model = "Cutlas Supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";

            // get properties of class
            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);
            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value); // {0:C} for first variable in currency form.

            // using car class instead of seperate method.
            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());
        }
Exemplo n.º 31
0
        static void Main(string[] args)
        {
            Car myCar = new Car(); //create new instance of myCar

            //Setting the properties
            myCar.Make  = "Oldsmobile";
            myCar.Model = "Cutlas Supreme";
            myCar.Year  = 1986;
            myCar.Color = "Silver";

            //Getting the properties
            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }
Exemplo n.º 32
0
        static void Main(string[] args)
        {
            //"Car myCar" declares new car in memory
            //"new Car()" creates or instantiates new instance of car object
            Car myCar = new Car();

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

            Console.WriteLine("{0} {1} {2} {3}",
                              myCar.Make,
                              myCar.Model,
                              myCar.Year,
                              myCar.Color);

            //decimal value = DetermineMarketValue(myCar);
            //Console.WriteLine("{0:C}", value);

            Console.WriteLine("{0:C}", myCar.DetermineMarketValue());

            Console.ReadLine();
        }