Question: Create 1. a program named shoelace_formula.py that utilizes the shoelace formula via the following steps: Create a function named getpoints that takes in as

Create 1. a program named shoelace_formula.py that utilizes the shoelace formula via the following steps:

Create 1. a program named shoelace_formula.py that utilizes the shoelace formula via the following steps: Create a function named getpoints that takes in as an argument a string and returns a list of points of arbitrary length. The string passed to the function contains pairs of numbers separated by commas, with each pair separated by a space, as shown in the format below. Have the function convert it to a list of points (the polygon's vertices). Each element in the list of points should itself be a list of one point. For the example shown below, your function should return: [[3, 4], [5, 61, [9, 51, [12, 8], [5, 11]] 2. Create a function named cross that takes in two arguments, both of which are a list of one point, and returns the cross-product. This is one step of the shoelace method. For example, if the points [1, 2] and [3, 4] are passed to the function, in that order, it will return -2. Cross product: (1 * 4) - (2 * 3) = -2 3. Create a function named shoelace that takes in as an argument a list of points and returns the area of the polygon calculated via the shoelace formula. The list of points passed to the function is the same list returned by your getpoints function. Your shoelace function should call your cross function. 4. Create a function named main that does not take in any arguments nor return any values. This function should take as input from the user a string of pairs of numbers separated by commas and spaces, as shown in the format below, and print the area of the polygon. Your main function should call your getpoints and shoelace functions. Format your output as shown below. 5. Finally, in your main code type the following: _main_ if name main () You should NOT include any other executable lines in your main code. Example output (using input 3,4 5,6 9,5 12,8 5,11): Please enter the vertices: 3,4 5,6 9,5 12,8 5,11 The area of the polygon is 30.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Python program that follows the specified steps python def getpointss points listmapint ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!