using System; namespace Electronics { class ElectronicDevices { public string brandName; public string modelNumber; public int wattsOfElectricity; } class Computer: ElectronicDevices { public int processorSpeed; public int memoryAmount; public int hardDriveSize; public void CollectComputerValues() { Console.WriteLine("What is the brand of your computer?"); brandName = (Console.ReadLine()).ToString(); Console.WriteLine("What is the model of your computer?"); modelNumber = (Console.ReadLine()).ToString(); Console.WriteLine("How many watts of electricity does your computer consume?"); wattsOfElectricity = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What is the processor speed of your computer in gigahertz?"); processorSpeed = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("How much memory does your computer store in megabytes of ram?"); memoryAmount = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What is the size of your hard drive in gigabytes?"); hardDriveSize = Convert.ToInt32(Console.ReadLine()); } public void ReturnComputerValues() { Console.WriteLine("Brand Name: " + brandName); Console.WriteLine("Model Number: " + modelNumber); Console.WriteLine("Watts of Electricity: " + wattsOfElectricity); Console.WriteLine("Processor Speed: " + processorSpeed + " gHz"); Console.WriteLine("Memory Amount: " + memoryAmount + " MB of RAM"); Console.WriteLine("Hard Drive Size: " + hardDriveSize + " GB"); } class Television : ElectronicDevices { public int screenSize; public string typeOfTelevision; public void CollectTelevisionValues() { Console.WriteLine("What is the brand of your television?"); brandName = (Console.ReadLine()).ToString(); Console.WriteLine("What is the model of your television?"); modelNumber = (Console.ReadLine()).ToString(); Console.WriteLine("How many watts of electricity does your television consume?"); wattsOfElectricity = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What is the screen size of your television in inches?"); screenSize = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("What type of television do you watch? (LCD, Plasma, CRT)?"; typeOfTelevision = (Console.ReadLine().ToString(); } public void ReturnTelevisionValues() { Console.WriteLine("Brand Name: " + brandName); Console.WriteLine("Model Number: " + modelNumber); Console.WriteLine("Watts Of Electricity: " + wattsOfElectricity); Console.WriteLine("Screen Size: " + screenSize + "in."); Console.WriteLine("Type Of Television: " + typeOfTelevision); } } class Program { public static void Main(string[] args) { int selectionValue; Console.WriteLine("Press 1 if you plan to enter information for your computer, or 2 if you plan to enter information for your television."); selectionValue = Convert.ToInt32(Console.ReadLine()); if (selectionValue == 1) { Computer myComputer = new Computer(); myComputer.CollectComputerValues(); myComputer.ReturnComputerValues(); } else { Television myTelevision = new Television(); myTelevision.CollectTelevisionValues(); myTelevision.ReturnTelevisionValues(); } Console.Write("Press Enter To TerminateÉ"); Console.Read(); } } }