A polygon is convex if it contains any line segments that connects two points of the polygon.
Question:
A polygon is convex if it contains any line segments that connects two points of the polygon. Write a program that prompts the user to enter the number of points in a convex polygon, then enter the points clockwise, and display the area of the polygon. Here is a sample run of the program:
Transcribed Image Text:
Enter the number of the points: 7 Enter the coordinates of the points: -12 0 -8.5 10 0 11.4 5.5 7.8 6 -5.5 0 -7 -3.5 -3.5 The total area is 250.075
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 63% (11 reviews)
Program Plan First define a Package polygon Define a Point class within the package This class store...View the full answer
Answered By
Amit Choudhary
I'm new in this profession regarding online teaching but previously i used to teach students near my college. I am teaching on online platform since last year and got good support from the students. I'm teaching on platforms like chegg and vedantu and also at my home in free time.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Programming Exercise 3.32 shows how to test whether a point is on an unbounded line. Revise Programming Exercise 3.32 to test whether a point is on a line segment. Write a program that prompts the...
-
A convex 4-vertex polygon is divided into four triangles, as shown in Figure 8.9 .Write a program that prompts the user to enter the coordinates of four vertices and displays the areas of the four...
-
A convex polygon is a polygon with the property that any line segment whose endpoints are on the polygon lies entirely within the polygon. The convex hull problem consists of finding the smallest...
-
Ratio Computation and Analysis; Liquidity) as loan analyst for Madison Bank, you have been presented the following information. Each of these companies has requested a loan of $50,000 for 6 months...
-
Let A be a 5 ( 3 matrix, let y be a vector in, and let z be a vector in. Suppose Ay = z. What fact allows you to conclude that the system Ax = 5z is consistent? 23
-
Ethical Problem Uncovered by Cost Estimation (LO3) Phoenix Management Company owns and provides management services for several shopping centers. After five years with the company, Mike Moyer was...
-
How do risk and inflation impact interest rates in the economy? AppendixLO1
-
1. Record the following 20X9 transactions in the Percy County General Fund General Ledger. Assume: a. The county entered into a capital lease for police safety equipment. The capitalizable cost of...
-
Absorption Statement Absorption costing does not distinguish between variable and fixed costs. All manufacturing costs are included in the cost of goods sold. Saxon, Inc. Absorption Costing Income...
-
The Daniels Tool & Die Corporation has been in existence for a little over three years. The company's sales have been increasing each year as it builds a reputation. The company manufactures dies to...
-
Rewrite Listing 5.1 RepeatAdditionQuiz.java to alert the user if an answer is entered again. Hint: use an array list to store answers. Here is a sample run: Listing What is 5 + 9? 12 Wrong answer....
-
Write a method that returns the union of two array lists of integers using the following header:public static?ArrayList union(ArrayList list1, ArrayList list2)For example, the union of two array...
-
Find the values of \(n_{1}\) and \(n_{2}\) in Exercise 5 . Data from Exercises 5 \(M F M F M F F F F F F M M M F F M M M M\) Determine the number of runs in the sequence. Then find the length of each...
-
You need to remove a bolt from a metal door. The maximum torque the bolt can withstand before starting to rotate is 7 = 70 N-m. You apply a wrench of m = 0.5 kg and 1 = 0.3 m long. You push down on...
-
Lesson 10.1: Emotional Intelligence Emotional Intelligence is a type of social intelligence that affords the individual the ability to monitor his own and others' emotions, to discriminate among...
-
Harriet??s annuity has a total cash value of $2000, and she has paid a total of $1,500 into it. Under a Section 1035 exchange, Harriet rolls the entire value of the annuity into a different annuity....
-
3. (30 pts total) Suppose that an automobile has the ability to accelerate from rest to a velocity of 100.0 mi/h in a time of 6.00 s. a. (15 pts) Assuming the acceleration is a constant, determine...
-
Factor completely. 2-2t+16
-
A void function named getInventory is passed four int variables named beginInv, sales, purchases, and endInv. The functions task is to calculate the ending inventory, using the beginning inventory,...
-
What is removed during each of the three stages of wastewater treatment: primary, secondary, and tertiary? During which state would you expect items to be recovered that were accidentally flushed,...
-
Write a program that prompts the user to enter an integer that represents an array size. Java generates a Number Form at Exception if the user attempts to enter a noninteger value using next Int ()....
-
Write a program that accepts a number of quarts from a user and converts the value to gallons. Include exception-handling capabilities in the program so that while any nonnumeric value is entered,...
-
Create a class that contains an array of 10 multiple-choice questions to which the user is required to respond with an A, B, or C. Display an error message if the user enters a character other than...
-
I need help trying to find this information for Kroger grocery stores. I need the most recent year, list the amounts reported for sales, cost of goods sold, and total net income. Does the amount...
-
Your grandmother gives you 2400 dollars for your birthday, which you invest in a mutual fund on January 1. On June 1, your fund balance is 7200 dollars, and you then deposit 1100 dollars (which you...
-
(Present-value comparison)You are offered $100,000 today or $360,000 in 13 years. Assuming that you can earn 12 percent on your money, which should you choose? If you are offered $360,000 in 13 years...
Study smarter with the SolutionInn App