Given a directed line from point p0(x0, y0) to p1(x1, y1), you can use the following condition
Question:
Given a directed line from point p0(x0, y0) to p1(x1, y1), you can use the following condition to decide whether a point p2(x2, y2) is on the left of the line, on the right, or on the same line (see Figure 3.11):
Write a program that prompts the user to enter the three points for p0, p1, and p2 and displays whether p2 is on the left of the line from p0 to p1, on the right, or on the same line. Here are some sample runs:
Transcribed Image Text:
>0 p2 is on the left side of the line – x0)*(yl – y0) { =0 p2 is on the same line (x1 – x0)*(y2 – y0) – (x2 <0 p2 is on the right side of the line pl 'pl pl p2 p2 p2 p0 p0 p0 (c) (b) Enter three points for p0, p1, and p2: 4.4 2 6.5 9.5 -5 4 (-5.0, 4.0) is on the left side of the line from (4.4, 2.0) to (6.5, 9.5) JEnter Enter three points for p0, pl, and p2: 1 1 5 5 2 2 (2.0, 2.0) is on the line from (1.0, 1.0) to (5.0, 5.0) JEnter Enter three points for p0, p1, and p2: 3.4 2 6.5 9.5 5 2.5 JEnter (5.0, 2.5) is on the right side of the line from (3.4, 2.0) to (6.5, 9.5)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 78% (14 reviews)
Program plan Prompt the user enter the three points for p0 p1 and p2 Determine whether the p2 is on ...View the full answer
Answered By
Ali Khawaja
my expertise are as follows: financial accounting : - journal entries - financial statements including balance sheet, profit & loss account, cash flow statement & statement of changes in equity -consolidated statement of financial position. -ratio analysis -depreciation methods -accounting concepts -understanding and application of all international financial reporting standards (ifrs) -international accounting standards (ias) -etc business analysis : -business strategy -strategic choices -business processes -e-business -e-marketing -project management -finance -hrm financial management : -project appraisal -capital budgeting -net present value (npv) -internal rate of return (irr) -net present value(npv) -payback period -strategic position -strategic choices -information technology -project management -finance -human resource management auditing: -internal audit -external audit -substantive procedures -analytic procedures -designing and assessment of internal controls -developing the flow charts & data flow diagrams -audit reports -engagement letter -materiality economics: -micro -macro -game theory -econometric -mathematical application in economics -empirical macroeconomics -international trade -international political economy -monetary theory and policy -public economics ,business law, and all regarding commerce
4.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...
-
Programming Exercise 6.39 gives a method for testing whether three points are on the same line.Write the following method to test whether all the points in the array points are on the same...
-
Programming Exercise 3.32 shows how to test whether a point is on the left side of a directed line, on the right, or on the same line. Write the methods with the following headers: Write a program...
-
Building a Case Study Analysis on Outsourcing, Find a minimum of three news articles discussing this issue, prepare the case study report that has three main parts: Summary and Overview of the issue...
-
We define the first difference f of a function f (x) by f (x) = f (x + 1) f (x). 37. Show that if f (x) = x2, then f (x) = 2x + 1. Calculate f for f (x) = x and f (x) = x3. 39. Show that for any two...
-
Productivity is the ratio of to the amount of __________________.
-
Consider what is specific about professional leadership in social work.
-
The Hanks Company has prepared the following changes in account balances for the worksheet to support its 2007 statement of cash flows: Additional information: The net income was $1,300. Depreciation...
-
The effective-interest method of amortization keeps interest expense at the same dollar amount of the bond's carrying value for every interest payment over the bond's life. 0 True O False
-
5,000 kg/h of water will be heated from 20C to 35C by hot water at 140C. A 15C hot water temperature drop is allowed. A number of double-pipe heat exchangers, each connected in series, will be used....
-
Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Chinese RMB. Prompt the user to enter 0 to convert from U.S. dollars to Chinese RMB and 1 to convert...
-
Suppose you shop for rice in two different packages. You would like to write a program to compare the cost. The program prompts the user to enter the weight and price of the each package and displays...
-
Eight dogs are selected for the final round of a dog show to compete for best of show. How many different ways can they line up to enter the ring? The judge then randomly chooses the dogs to parade...
-
How do intersectionality and identity salience intersect within the framework of diversity and inclusion initiatives, and what strategies can organizations employ to address these complexities ?
-
(a) -2-3 3. Evaluate the following determinants: 3 5 (b) |- 58 -8 -2 4 312 4 3 0 (c) 2 245 (d) 3 1 2 245 5 -1 -4
-
The following information pertains to the inventory of Parvin Company for Year 3: January 1 April 1 October 1 Beginning inventory 400 units @ $22 Purchased 2,600 units @ $27 Purchased 1,200 units @...
-
Using partial fraction decomposition to find the partial fractions of the function 26x2 +270x+404 f(x) = f(x) = 30x3 20x2-330x 280 Hint: The denominator of f(x) can be factored as (3x+7) (5x+5)(2x-8)...
-
Question 1: How do strategy and tactical action relate to each other in an organization? Question 2: How can you improve the implementation of strategy in this business organization?...
-
Determine the horizontal and vertical components of force which the pins at A and B exert on the frame. 2 m 400 N/m 1.5 m E 3 m 3 m F 1.5 m B
-
Find a least expensive route, in monthly lease charges, between the pairs of computer centers in Exercise 11 using the lease charges given in Figure 2. a) Boston and Los Angeles b) New York and San...
-
Define a new class named UnweightedGraphWithGetPath that extends UnweightedGraph with a new method for finding a path between two vertices with the following header: public List getPath(int u, int...
-
Define a new class named UnweightedGraphDetectCycle that extends UnweightedGraph with a new method for determining whether there is a cycle in the graph with the following header: public boolean...
-
Define a new class named UnweightedGraphFindCycle that extends UnweightedGraph with a new method for finding a cycle starting at vertex u with the following header: public List getACycle(int u); The...
-
About 'Internal Controls and Cash and how risk assessment and adequate control procedures are needed to protect and minimize losses. Share how cultural preferences, demography, age, economic status,...
-
ignore question 3 just do bond A and Bond B the second photo Bond A: The $1,000 par value bond matures in 8 years, with a coupon rate of 10%. With one payment per year you estimate the Yield to...
-
The profitability of a deposit in euros expressed in dollars is: Select one: approximately the rate of appreciation of the dollar against the euro approximately the European market interest rate plus...
Study smarter with the SolutionInn App