Write a Java program

I have a Java program that just needs to be tweaked to make simpler, basically just to redo the code without the loop. here’s the code import java.util.*;public class PossibleCircle {  public static void main(String[] args)    {    Scanner input = new Scanner(System.in);       int runningTotal = 0;    int currentInput;     int[] radius_inch = new int[5];int total=0;double area;double circumference;double radius_cm;double average;    final double IN_TO_CM = 2.54;System.out.println(‘Enter radius for each circle in inches’);for(int i=0;i<5;i++){System.out.print('Enter radius of circle '+ (i+1) + ':' );radius_inch[i] = input.nextInt();total = total + radius_inch[i];}        System.out.print('Radius (in.)  ');        System.out.print('Radius (cm.)  ');        System.out.print('Area (sq. cm.)  ');        System.out.println('Cirumference (sq. cm.)');System.out.println('__________________________________________________________________________________________________');for(int i=0;i<5;i++)           {radius_cm = IN_TO_CM * radius_inch[i];area =  Math.PI * radius_cm * radius_cm;circumference = 2 * Math.PI * radius_cm;System.out.printf('%10dtt%10.1ftt%10.1ftt%10.1fn',radius_inch[i],radius_cm,(double)Math.round(area*10)/10, (double)Math.round(circumference*10)/10);}average = total/5;double d = (double)Math.round(average*10)/10;    System.out.println('The average of all the radii is:' + d +' inches.');  }}

Looking for this or a Similar Assignment? Click below to Place your Order

Open chat
%d bloggers like this: