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); }
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(); }
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); }