Question
Assessment 3: Decision MakingInstructions This assessment is designed to be completed in fifty minutes or less. Your code must work on any valid inputs to
Assessment 3: Decision MakingInstructions This assessment is designed to be completed in fifty minutes or less. Your code must work on any valid inputs to receive credit. Complete the template below such that you will provide code to solve the following problems. When you are satisfied with your solution, you should upload your solution to Marmoset. Marmoset will grade your solution within about a minute; you may modify your solution and resubmit while taking this assessment to get a higher score as necessary. Imagine that the user specifies with width and height of a grid. You will return a string that represents all ordered tiles that make up the corners of the grid, with three tiles to a corner. You will return a string where each tile has a space after it (this will simplify your algorithm). For example, on a 7x10 grid,
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 14 | |||||
15 | ||||||
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | ||||||
36 | ||||||
43 | ||||||
50 | ||||||
57 | 63 | |||||
64 | 65 | 66 | 67 | 68 | 69 | 70 |
you would return the string "1 2 6 7 8 14 57 63 64 65 69 70 ". If the board doesn't have a width or height of at least four, you should return the tiles of all the edges. Under such cases, you want to avoid putting duplicate tiles in your strings; to do this, use the python in boolean expression: "12" in "11 12 13 " would return True, while "10" in "11 12 13 " would return False. You may use the following formulas in your solution as needed: row = (tile - 1) // width Remember that you can check if a string is not in another string with something like "2" not in "1 2 3 " (which would return False).Testing Your Code When you are ready, right-mouse-click to save the file driver to the same directory as your project3.py. Also download and save the tests3_sample.txt to the same directory. You can then run your code against our test cases through the terminal with the command" python driver3_sample.py This will test your code on the same test cases as Marmoset, and give you a report. Once you've passed as many tests as you can, upload your submission to Marmoset using the instructions at the bottom of the page. Code Templates Download the code project3.py answer template for this assessment. Right-mouse click and save the file as project3.py. Its contents are as follows: def getCorner(width, height): width = width height = height #YOUR CODE GOES HERE (indented) return "fixme" #END YOUR CODE
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