Question: Integer variables sideA, sideB, and sideC are read from input, representing the lengths of the three sides of a triangle. Assign triPerimeter with the perimeter

Integer variables sideA, sideB, and sideC are read from input, representing the lengths of the three sides of a triangle. Assign triPerimeter with the perimeter of the triangle.
Ex: If the input is 82018, then the output is:
Perimeter: 46
Note: The perimeter of a triangle is calculated by adding all three sides together.
import java.util.scanner;
public class Triangleperimeter {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
int sideA;
int sideB;
int sidec;
int triperimeter;
sideA = scnr * nextInt ();
sideB = scnr. nextInt();
sideC = scnr. nextInt();
/* Your code goes here */
G),
}
System.out.println("Perimeter: "+ triPerimeter);
}
 Integer variables sideA, sideB, and sideC are read from input, representing

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!