Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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