subject

Triangle Perimeters Saved Convert the following solution to one that uses an additional method to calculate a triangles perimeter by completing the four TODOs in the starter code public static void main(String args) { Calculate the perimeter of triangle 10.0) (1.1) and (1.5.1) double side 1-getDistance0,0,1,1); double side2-getDistance0.01.1); double side 3-getDistance: double perimeter - side1 side2 side3; System. out. println("The perimeter of triangle 10.0) (1.1) and (1.5-1) + perimeter); o calculate the perimeter of triangle 10.1 10.4) and 14.4 side 1-getDistance 01.04 side-getDistance: sida3-getDistancefl.14.0, ); perimeter side 1 side2 side3 System. out printin (The perimeter of triangle 10,1 104) and (4,4) + perimeten Calculate the periter of triangle that acenters Scanner input new Scanner(System. in System. out. print("Enter your first point) doublex input nextDouble doubleyi input. nextDouble System. out. print Enter your second pointed double 2 Input. nextDouble(): double y2 - input nextDouble: System. out. printlnter you thin po doublex3input. nextDouble doubly input nextDouble 12 13 14 15 16 19 10 19 20 21 22 Calculate the perimeter of triangle 0.1 sido1aget Distance(0,1,04); side2get Distance(0,44,4); olde3getDistance(4,14,0,0); perimeter- side 1+aide2+aldes; System. out. println ("The perimeter of triangle (0.11 0.4) and (44): " + perimeter): Calculate the perimeter of triangle that user enters Scanner Input - new Scanner(System. in); System. out. print("Enter your first point x1 y1): "); double x1 - Input nextDouble(; doubley1 = Input. nextDouble(: System. out. print("Enter your second point(x2.y2): "); double x2 - Input nextDouble : double y2 - input. nextDouble(); System. out. print("Enter your third pointx3y3): "); double x3 - input. nextDouble): double y3 - input nextDouble0:1 side 1 - getDistance(x1.y1.x2.42): side2 - getDistance(x2.72.x3.73); side3 - getDistance(x3.3.x1.yt); perimeter - side 1+side2+side3. System. out. printin ('The perimeter of triangle ("***""+y+""+x2+""+2") and [**3+*+y3: " + perimeter): 25 710 public static double getDistance(double x1, double yt double x2, double y2) return Math sqrt(x1-x2)*(x1-x2)+ly1.part1-21 2 6 8 9 TrianglePerimeter2java New import java. util. Scanner; 3. public class TrianglePerimeter2 public static void main(String[] args) { 5 // TODO2: Replace e. e below with a method invocation to calcTrianglePerimeter to calculate the perimet double perimeter = e. e; 7 System. out. printf ("The perimeter of triangle (0,0) (1,1) and (1.5,-1): %.2f\n", perimeter); 11 TOD03: Replace 2.0 below with a method invocation to calcTrianglePerimeter to calculate the perimete le perimeter = 0.8; System. out. printf ("The perimeter of triangle (0,1) (0,4) and (4,4): %.2f\n", perimeter); 12 13 1/ Calculate the perimeter of triangle that user enters 14 Scanner input = new Scanner(System. in); 15 System. out. print("Enter your first point(x, y1): "); 16 double xd - input. nextDouble(); 17 double yi - input. nextDouble(); System. out. print("Enter your second point(x2,y2): "); 19 Countdown 28 11 18 TrianglePerimeter2java New # Full SC System. out. print("Enter your second point(x2,y2): "); double x2 = input. nextDouble(); double y2 = input. nextDouble(); System. out. print("Enter your third point(3,y3): "); double x3 - input. nextDouble(); double y3 = input. nextDouble(); // TODO4: Replace 0.0 below with a method invocation to calcTrianglePerimeter to calculate the perimeter for triangle that use perimeter = 0.0; System. out. printf ("The perimeter of triangle ("d","y1.-) (*-x2", "y2-") and (*-*3","13"): 2.2F\n", perimeter); public static double getDistance(double xd, double yi, double x2, double y2) { return Math. sqrt((xd x2) (1-x2) (y1 y2) (y1 y2)); W 10001 Define a new method caletranglePerimeter that calculates the perimeter of triangle iven the coordinates of the thru

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:50
Write a 3-4 page apa formatted paper comparing your organization’s it strategy with the best practices outlined in your course text. content should include, but not be limited to: developing and delivering on the it value, developing it strategy for the business value and linking it to business metrics. your paper should include an abstract and a conclusion and a reference page with 3-5 references
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
You know the right answer?
Triangle Perimeters Saved Convert the following solution to one that uses an additional method to ca...
Questions