Question: SUBJECT: JAVA can you answer ASAP in simplest way: Complete the following skeleton code so that it can compute the circumference of a rect, square,
SUBJECT: JAVA
can you answer ASAP in simplest way:
Complete the following skeleton code so that it can compute the circumference of a rect, square, or triangle.
import java.util.Scanner; public class Question1x { public static void main(String[] args) { Scanner input = new Scanner(System.in); // compute the circumference of a shape // See sample output System.out.println( "I can compute the circumference of one of the followings: Rect, Square, or Triangle " ); System.out.print( "Enter a shape: " ); String shape = input.nextLine().trim(); int circum = 0; int side1, side2, side3; // Your code here System.out.println( "The circumference is : "+ circum); input.close(); } }
The following is a sample output.

I can compute the circumference of one of the followings: Rect, Square, or Triangle Enter a shape: Rect Enter width: 10 Enter hieght: 20 The circumference is : 60 I can compute the circumference of one of the followings: Rect, Square, or Triangle Enter a shape: Square Enter side: 15 The circumference is : 60 U VRIU IU Luvu mpLIVES I LIVIU yuravera VII LUITIUICIJU U.U. JUULILIT Juveel wu, LULU, HLUTUM I can compute the circumference of one of the followings: Rect, Square, or Triangle Enter a shape: Triangle Enter side1: 12 Enter side2: 13 Enter side3: 14 The circumference is : 39
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
