示例#1
0
        private Automobile createAutomobileFromUser()
        {
            Automobile automobile = new Automobile(promptForString("Vin Number: "), promptForString("Model: "), promptForString("Make: "), promptForInteger("Year: "));

            automobile.Color = promptForString("Color: ");
            automobile.Owner = promptForString("Owner: ");

            return(automobile);
        }
示例#2
0
 private void displayInfo(string automobileName, Automobile automobile)
 {
     Console.WriteLine(automobileName);
     Console.WriteLine("[Make]: " + automobile.Make);
     Console.WriteLine("[Model]: " + automobile.Model);
     Console.WriteLine("[Year]: " + automobile.Year);
     Console.WriteLine("[Owner]: " + automobile.Owner);
     Console.WriteLine("[Color]: " + automobile.Year);
     Console.WriteLine("[Vin Number]: " + automobile.VinNumber);
     Console.WriteLine();
 }
示例#3
0
        public void MainMethod()
        {
            Console.WriteLine("First Automobile: ");
            Automobile firstAutomobile = createAutomobileFromUser();

            Console.Clear();

            Console.WriteLine("\nSecond Auromobile: ");
            Automobile secondAutomobile = createAutomobileFromUser();

            Console.Clear();

            displayInfo("FirstAutomobile:", firstAutomobile);
            displayInfo("SecondAutomobile:", secondAutomobile);
        }