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 then the output is:
Perimeter:
Note: The perimeter of a triangle is calculated by adding all three sides together.
import java.util.scanner;
public class Triangleperimeter
public static void mainString 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.printlnPerimeter: triPerimeter;
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
