Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build an Intersection Check program in Java using Eclipse IDE. User inputs two points as x-y coordinates in two dimension space. Two points represent two

Build an Intersection Check program in Java using Eclipse IDE.

User inputs two points as x-y coordinates in two dimension space. Two points represent two end points of a line segment. Then, user can input second two points for the second line segment. With the two line segments, the program checks whether or not the two line segments intersect. The program displays 1 if the two line segments are intersect. Otherwise, display 0.

Please implement your algorithm in Java but not use API. Hint: use slope and intercept Input: Four x-y coordinates that represent two point for the first line segment and two points for the second line segments Output: 0 or 1 that represents intersection or no intersection

Please use basic statements for beginners: if/else, while loops, for loops, basic arrays, and try to only use import java.util.Scanner;

Example Input: 7 8 5 12 10 10 3 10

Output: 1

Do you want to test again? Y

Input: 5 10 5 2 2 1 8 7

Output: 1

Do you want to test again? Y

Input: 10 10 3 10 6 3 6 6

Output: 0

Do you want to test again? Y

Input: 5 4 8 6 10 6 5 1

Output: 0

Do you want to test again? N

Thank you!

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions