Exemplo n.º 1
0
        static void Main(string[] args)
        {
            RoadTrip chores   = new RoadTrip();
            RoadTrip vacation = new RoadTrip();

            // chores
            chores.Miles        = 50.0;
            chores.HoursElapsed = 4.00;
            chores.GallonsUsed  = 1.20;

            // vacation
            vacation.Miles        = 202.50;
            vacation.HoursElapsed = 5.00;
            vacation.GallonsUsed  = 58.90;

            // display road trip info
            Console.WriteLine(chores.Miles);
            Console.WriteLine(chores.HoursElapsed);
            Console.WriteLine(chores.GallonsUsed);

            Console.WriteLine();

            Console.WriteLine(vacation.Miles);
            Console.WriteLine(vacation.HoursElapsed);
            Console.WriteLine(vacation.GallonsUsed);

            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            RoadTrip chores   = new RoadTrip();
            RoadTrip vacation = new RoadTrip();

            chores.Miles        = 10.3;
            chores.GallonsUsed  = 0.5;
            chores.HoursElapsed = 1;

            vacation.Miles        = 200;
            vacation.GallonsUsed  = 20;
            vacation.HoursElapsed = 4;

            Console.WriteLine("For the chore: miles: {0}, gallons: {1}, hours: {2}", chores.Miles, chores.GallonsUsed, chores.HoursElapsed);
            Console.WriteLine("For the chore: vacation: {0}, gallons: {1}, hours: {2}", vacation.Miles, vacation.GallonsUsed, vacation.HoursElapsed);
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            RoadTrip chores   = new RoadTrip();
            RoadTrip vacation = new RoadTrip();

            chores.Miles        = 70.00;
            chores.HoursElapsed = 2.00;
            chores.GallonsUsed  = 1.50;

            vacation.Miles        = 800.00;
            vacation.HoursElapsed = 12.00;
            vacation.GallonsUsed  = 9.00;

            Console.WriteLine(chores.Miles);
            Console.WriteLine(chores.HoursElapsed);
            Console.WriteLine(chores.GallonsUsed);

            Console.WriteLine();  // add a blank line to the output

            Console.WriteLine(vacation.Miles);
            Console.WriteLine(vacation.HoursElapsed);
            Console.WriteLine(vacation.GallonsUsed);
        }