Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:50, brennarfa
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
image
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, seaotter7140
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
image
Computers and Technology, 23.06.2019 08:00, hernandez09297
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
Do you know the correct answer?
Triangle Perimeters Saved Convert the following solution to one that uses an additional method to ca...

Questions in other subjects:

Konu
Spanish, 11.10.2019 22:30