Question
In this problem, you will be given a StatCan SGC code for a Nova Scotia municipality and output the name of the county in which
In this problem, you will be given a StatCan SGC code for a Nova Scotia municipality and output the name of the county in which the municipality is located. Statistics Canada, often called StatCan, is the statistical agency of the Canadian Government. It uses the Standard Geographical Classification (SGC) to classify geographical locations in Canada when taking a census. The SGC is a 7-character long unique code which identifies the region, province or territory, a division of the province or territory (referred to as the census division), and the municipality (census subdivision). If an SGC were stored in a Python String variable, the indexes at which each piece of data is stored would be: Index Information 0 Geographical region 1 Province or Territory 2-3 Census division 4-6 Census subdivision For example, 1209034 is the SGC for Halifax: Code Information 1 Atlantic Region 2 Nova Scotia 09 Halifax County (All census divisions are counties in Nova Scotia) 034 Halifax (Census subdivision is the Halifax municipality) That is, Halifax is located in Halifax County in the province of Nova Scotia in the Atlantic Region of Canada. Your program will identify the county for a given Nova Scotian SGC. The following are Nova Scotias eighteen (18) counties and their codes: Code County Name 01 Shelburne 02 Yarmouth 03 Digby 04 Queens 05 Annapolis 06 Lunenburg 07 Kings 08 Hants 09 Halifax 10 Colchester 11 Cumberland 12 Pictou 13 Guysborough 14 Antigonish 15 Inverness 16 Richmond 17 Cape Breton 18 Victoria Input: The program will receive two lines of input: Input an SGC for a census subdivision or municipality in Nova Scoita (string) and store it to a variable called SGC. All SGCs will be seven (7) characters long as explained above in the introduction. Input the municipality name (string) and store it to a variable called municipality. Processing: Your job in this problem is to: Create a list variable called counties and store the eighteen (18) Nova Scotian county names to the list. Using the appropriate information from SGC and the counties list, find out what county the municipality in located in and store it to countyName. Output: Output must look like the following: [municipality] is located in [countyName] County. where: [municipality] is replaced with the value of the variable municipality. [countyName] is replaced with the value of the variable countyName. Examples: Input Output 1201001 Barrington Barrington is located in Shelburne County. 1202001 Argyle Argyle is located in Yarmouth County. 1205008 Annapolis Royal Annapolis Royal is located in Annapolis County. 1206009 Chester Chester is located in Lunenburg County. 1209034 Halifax Halifax is located in Halifax County.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started