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 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 3
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
You know the right answer?
Triangle Perimeters Saved Convert the following solution to one that uses an additional method to ca...
Questions
question
Computers and Technology, 14.12.2020 22:40
question
Mathematics, 14.12.2020 22:40
question
Social Studies, 14.12.2020 22:40
Questions on the website: 13722362