Question: Practical Assignment Task 0 1 Write a program to solve the problem specified below: Problem. ( geometry ) Given two points with 2 D coordinates

Practical Assignment Task 01
Write a program to solve the problem specified below:
Problem. (geometry) Given two points with 2D coordinates (x1,y1) and (x2,y2). Write a JAVA program to compute two result values as follows:
The distance between the points. Formula for computing the distance is Note: you can use sqrt(val) or pow(val,0.5) to compute square root of val.
The slope of the line that connects the points. Formula to compute the slope is defined as the following expression: y2-y1x2-x1
Instructions for program implementation: All the solution to be capsulated as contents of the main() method. Spaghetti code solution
The program to be implemented in two variants:
Write a Java console application that prompts the user to enter 2D coordinates of two points (x1,y1) and (x2,y2) and displays result values: the distance between the points and the slope of the line that connects the points. Use instance of the Scanner class for input. Use methods System.out.print()/println() for output. Comment lines to be inserted. two
Write a Java dialog box application that prompts the user to enter 2D coordinates of two points (x1,y1) and (x2,y2) and displays two result values: the distance between the points and the slope of the line that connects the points. Use JoptionPane class method showInputDialog() for input and method showMessageDialog () for output. Comment lines to be inserted.
 Practical Assignment Task 01 Write a program to solve the problem

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!