Question
Answer these Reflective Questions As fast as possible Below is my code that I have used Which functions did you use a nested structure (nested
Answer these Reflective Questions As fast as possible
Below is my code that I have used
Which functions did you use a nested structure (nested loops, nested conditionals, etc) to implement the requirements? Would it have been possible to implement them without using a nested structure? Which functions did you not use a nested structure? Would it have been possible to implement them with a nested structure?
Suppose we wanted to create an additional map classification called 'Urban City' which is indicated by the number of 'R' cells plus the number of 'C' cells being between 60% and 80%. Can we do this? How might this affect our classify_map() function?
How many test cases would you need to confirm that your classify_map() function correctly identifies a "Farmland" map? Explain what your test cases would be.
main.py Returns: (string) : A map classification according to rules. \#Get total number of cells in the map variable - rows * columns totalcells = len (mapdata)1en(mapdata[]) \#Check if no of R cels is greater than 50% of all cells If( countType(map_data, ' R)>(0.5 totalcells)): return "Suburban" \#Check if no of A cels is greater than 50% of all cells elif (countType (map_data, ' A)>(0.5totalcells) ): return "Farmland" \#Hheck if no of U cels and W cells are greater than 50\% of all cells elif ((countType(map_data, 'U')+countType(map_data, 'W'))>(0.5*totalcells)): return "Conservation" \#Check if no of C cels is greater than 50% of all cells elif (countType (map_data, 'C') >(0.5 totalcells)): \#If greater; check if no of U cells and A cells between 10 to 20 percent UA= countType (map_data, 'U')+countType(map_data, 'A') if (UA>=10 and UAStep 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