Question: Data may not be modified once assigned or bound, and all data types must be immutable(in Scala). Recall (or discover) that a simple polygon is

Data may not be modified once assigned or bound, and all data types must be immutable(in Scala).
Recall (or discover) that a simple polygon is a closed sequence of n > 2 non-intersecting, connected straight-line segments. We can represent it as a series of ordered pairs of numbers (coordinates), moving either clockwise or counter-clockwise around the boundary. For example the polygon, (18,29) 1,24 20,15 35,17 10,-3 can be represented in a text file as n pairs of numbers, 1 24 20 15 18 29 35 17 10-3 The "Shoelace Formula" is a well known technique for computing the area of any simple polygon. It computes the area from the formula, n- 2 Give a scala function that computes the area of a polygon. Your shoelace function should receive the name of file containing coordinates as a String, and return the area as a Double value. Recall (or discover) that a simple polygon is a closed sequence of n > 2 non-intersecting, connected straight-line segments. We can represent it as a series of ordered pairs of numbers (coordinates), moving either clockwise or counter-clockwise around the boundary. For example the polygon, (18,29) 1,24 20,15 35,17 10,-3 can be represented in a text file as n pairs of numbers, 1 24 20 15 18 29 35 17 10-3 The "Shoelace Formula" is a well known technique for computing the area of any simple polygon. It computes the area from the formula, n- 2 Give a scala function that computes the area of a polygon. Your shoelace function should receive the name of file containing coordinates as a String, and return the area as a Double value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
