Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3: Intersecting Point Suppose two line segments intersect. The two endpoints for the first line segment are (x1, y1) and (x2, y2) and for

image text in transcribedimage text in transcribed

Problem 3: Intersecting Point Suppose two line segments intersect. The two endpoints for the first line segment are (x1, y1) and (x2, y2) and for the second line segment are (x3, y3) and (x4, y4). Write a program that prompts the user to enter these four endpoints and displays the intersecting point. Note: The intersecting point can be found by solving the following linear equation: Use the LinearEquation class in the previous problem to solve this equation and find the intersecting point. Sample input/Output Enter x1, y1, x2, y2, x3, y3, x4, y4: 1.5 7 5 -0.5-3 -1.25 4.6 The intersecting point is: (3.22, 3.31) Enter x1, y1, x2, y2, x3, y3, x4, y4: 3 6 -26 4.5 3-5.6 3 The two lines do not cross Problem 2: Linear Equation Design a class named LinearEquation for a 2 2 system of linear equations: ar +by-eed bf af -ec x+ dy-ad-bcad-be The class should implement: A constructor with arguments The get methods for all private data fields A method named isSolvable() that returns true if ad bc is not 0 Methods getX0) and getY() that return the solution for the equation. . . Write a test program that prompts the user to enter a, b, c, d, e, and f and displays the result. If ad bc is 0, output that "The equation has no solution." Sample input/Output Enter a, b, c, d, e, f: 1-2 3 -4 57 x is -3.00 and y is -4.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions

Question

=+31-5 Explain how sensory memory works.

Answered: 1 week ago