/// <summary> /// Initializes a new instance of the <see cref="IndianCensusDAO"/> class. /// </summary> /// <param name="indianCensusCSV">Indian Census POCO class object.</param> public IndianCensusDAO(IndianCensus indianCensusCSV) { this.state = indianCensusCSV.State; this.areaInSqkm = indianCensusCSV.TotalArea; this.population = indianCensusCSV.Population; this.densityPerSqKm = indianCensusCSV.PopulationDensity; }
/// <summary> /// Method to return densely populated state among US and India. /// </summary> /// <param name="indianCensus">Indian Census POCO class.</param> /// <param name="usCensus">US Census POCO class.</param> /// <returns>Densely populated state among US and India.</returns> public string GetMostPopulousStateWithDensity(IndianCensus indianCensus, USCensus usCensus) { string denselyPopulatedState = (indianCensus.PopulationDensity > usCensus.DensityPerSqKm) ? indianCensus.State : usCensus.State; return(denselyPopulatedState); }