Question: 1. Write a program that prompts the user to enter two arrays of integers and displays the common elements that appear in both arrays. Note

 1. Write a program that prompts the user to enter two

1. Write a program that prompts the user to enter two arrays of integers and displays the common elements that appear in both arrays. Note that the first number in the input indicates the number of the elements in the list. This number is not part of the list. Here is a sample run. Enter listi: 5 5 2 10 1 6 Enter list2: 9 2 3 10 3 34 35 67 3 1 The common elements are 2 10 1 2. Write a program that prompts the user to enter the points of a convex polygon and display its area. Assume that the polygon has six end points and the points are entered clockwise. For the definition of a convex polygon, see http://www.mathopenref.com/polygonconvex.html. Hint: the total area of a polygon is the sum of the areas of the small triangles as shown below: p1 p2 p3 p5 p4 A convex polygon can be divided into small non-overlapping triangles Here is a sample run of the program: Enter the coordinates of six points: -8.5 10 0 11.4 5.5 7.8 6 -5.50 -7 -3.5 -3.5 The total area is 183.95

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!