e. Create a function that will allow your robot to draw something that approximates an equilateral...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
e. Create a function that will allow your robot to draw something that approximates an equilateral triangle when in pen down mode. Your function should accept at least one parameter to define the edge length of the triangle. Write a program that makes use of your function to draw a triangle, drive forwards away from the triangle, and then draw a second triangle with a side length half that of the first triangle. Finally, the robot should drive clear of the second triangle. Figure 1 shows an example of the sort of output we would expect to see. Figure 1 Example of desired output for part (e) Run your code using the following simulator setup magic: %%sim_magic_preloaded -- autorun - Cp -b Empty_Map -x 100 -y 700 -a -90 Your answer should include your code and a screenshot of the simulator after running the code. (8 marks) e. Create a function that will allow your robot to draw something that approximates an equilateral triangle when in pen down mode. Your function should accept at least one parameter to define the edge length of the triangle. Write a program that makes use of your function to draw a triangle, drive forwards away from the triangle, and then draw a second triangle with a side length half that of the first triangle. Finally, the robot should drive clear of the second triangle. Figure 1 shows an example of the sort of output we would expect to see. Figure 1 Example of desired output for part (e) Run your code using the following simulator setup magic: %%sim_magic_preloaded -- autorun - Cp -b Empty_Map -x 100 -y 700 -a -90 Your answer should include your code and a screenshot of the simulator after running the code. (8 marks)
Expert Answer:
Answer rating: 100% (QA)
The Python code for the function and the program to draw the triangles im... View the full answer
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date:
Students also viewed these programming questions
-
Find the quotient. z Z+10z + 16 2 z +11z+24 2 z +2z z+9z+18
-
Simpson Auto Body Repair purchased $20,000 of Machinery. The company paid $8,000 in cash at the time of the purchase and signed a promissory note for the remainder to be paid in four monthly...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Think about someone you know who is an entrepreneur. What are the advantages of owning their own business? What are the disadvantages? Why did they start their business? What method did they use to...
-
Discuss the accounting treatment or disclosure that should be accorded a declared but unpaid cash dividend; an accumulated but undeclared dividend on cumulative preferred stock; a stock dividend...
-
Based on the following information, calculate the sustainable growth rate for Southern Lights Co.: Profit margin = 8.1% Capital intensity ratio = .45 Debt-equity ratio = .55 Net income = $120,000...
-
A horizontal metal strip \(1.0 \mathrm{~mm}\) thick and \(20 \mathrm{~mm}\) wide carries a 20-A current along its length, and both the length and the width are perpendicular to a uniform magnetic...
-
Complete the following table and answer the accompanying questions. a. At what level of the control variable are net benefits maximized? b. What is the relation between marginal benefit and marginal...
-
The standard interface technology for wireless networks is _ _ _ _ _ _ _ _ _ _ . The hardware component necessary for computers to connect to these networks is a _ _ _ _ _ _ _ _ _ _ .
-
In 2012, George wright started the Old Oregon Wood Store to man-ufacture Old Oregon tables. Each table is carefully constructed by hand using the highest- quality oak. Old Oregon tables can support...
-
Write a paper on 10 Poisonous Household Substances
-
You have started a project working with your peers at your rival college to create a cross-town help-out. You want to encourage many people in the community to contribute a days work on a Saturday...
-
Give an example of how a project manager could run into problems with cash flow, even when they are within budget on the overall project.
-
In the 1980s, two healthcare organizations with distinct cultures attempted a merger that soon ran into trouble. How, and why, are mergers difficult? Consider the following history In 1975, Idaho...
-
1. Purchasing land in areas that have potential for future growth makes sense, as the cost of land tends to be substantially cheaper 1020 years before it is turned into a developed suburban area. At...
-
What is an Agile spike, and when would it be used?
-
A population is growing according to P = Poe016t. Find the doubling time. Round your answer to one decimal place. years.
-
Eleni Cabinet Company sold 2,200 cabinets during 2011 at $160 per cabinet. Its beginning inventory on January 1 was 130 cabinets at $56. Purchases made during the year were as follows: February . 225...
-
I. Describe the six general phases of a traditional SDLC approach and how the waterfall model is applied to the phases. II. Justify the reasons that once a system is implemented, it is often...
-
I. Establish that the primary goal of readiness and review is to keep information security programs functioning as they are designed and continuously over time. II. Examine the three tasks that can...
-
Acknowledge the fact that modern information processing systems are highly complex and rely on numerous internal and external connections. Conclude that networks are the highway in which information...
-
Consider two inertial frames \(\mathcal{O}\) and \(\mathcal{O}^{\prime}\) where \(\mathcal{O}^{\prime}\) is moving with velocity \(\mathbf{v}\) relative to \(\mathcal{O}\). We split all three-vectors...
-
We discovered in the text that the scalar and vector potentials are components of a four vector \(A^{\mu}=(\phi, \mathbf{A})\). In this problem, we will take as given the existence of this...
-
A cyclotron is made of sheet metal in the form of an empty tuna-fish can, set on a table with a flat-side down and then sliced from above through its center into two D-shaped pieces. The two "Dees"...
Study smarter with the SolutionInn App