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
Write a program to solve the problem specified below:
Problem. geometry Given two points with D coordinates xy and xy 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 sqrtval or powval 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:
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 D coordinates of two points xy and xy 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.printprintln for output. Comment lines to be inserted. two
Write a Java dialog box application that prompts the user to enter coordinates of two points and 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
