Question
Write a Java program to read three points that can form a triangle and then to find the smallest upright rectangle containing the triangle. use
Write a Java program to read three points that can form a triangle and then to find the smallest upright rectangle containing the triangle. use non advanced methods bacsue i am a ne students and just trying to learn the basics.
this is what i have so far,
import java.util.Scanner;
public class HW2 {
public static void main(String[] args) { Scanner in = new Scanner ( System.in); double x1, x2, x3, y1, y2, y3; System.out.println("Enter first point of triangle (x,y): "); x1 = in.nextDouble(); y1 = in.nextDouble(); System.out.println("Enter second point of triangle (x,y) : "); x2 = in.nextDouble(); y2 = in.nextDouble(); System.out.println("Enter third point of triangle (x,y): "); x3 = in.nextDouble(); y3 = in.nextDouble();
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