public void AddNewsmartphones() { string camera; string Country_made; int Cost; int display; Console.Write("\nEnter a camera of smartphones: "); Excerpt = Console.ReadLine(); Console.Write("Enter a country made of smartphones: "); Country_made = Console.ReadLine(); Console.Write("Enter a smartphones price: "); while (!int.TryParse(Console.ReadLine(), out Cost) || Cost <= 0) { Console.Write("Enter a correct speed value, please: "); } Console.Write("Enter a display size of smartphones: "); while (!int.TryParse(Console.ReadLine(), out size) || size > 10 || size < 0) { Console.Write("Enter a correct size, please: "); } smartphones newsmartphones = new smartphones(camera, Country_made, Cost, display); nap.Add(newsmartphones); }
public void DisplayInfoAboutsmartphones(smartphones smartphones) { Console.WriteLine("\ncamera : {0}\nCountry_made : {1}\nCost : {2}\ndispaly : {3}", smartphones.camera, smartphones.Country_made, smartphones.Cost, smartphones.display); }