Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello i have my code done but dont have access to my Java program. Can somone in

ID: 3647387 • Letter: H

Question

Hello i have my code done but dont have access to my Java program. Can somone input this in the program then show a screenshot of of the output?

while(goodInput == true){
//try/catch all that good stuff
}
if you cant get it to work let me know I post it ;)
So I did this in a very simple manner here is the circle class:

public class Circle1

{

public static double circumference(double radius)

{

//circumference = pie * diameter

double diameter, circumference;

diameter = 2*radius;

circumference = Math.PI * diameter;

return circumference;

}

public static double area(double radius)

{

//area = pie*r^2

double area;

radius = Math.pow(radius, 2);

area = Math.PI * radius;

return area;

}

}
Here is the circleTest class

import java.text.DecimalFormat;

import java.text.NumberFormat;

import javax.swing.JOptionPane;

public class CircleTest extends Circle1

{

public static void main(String[] a)

{

double radius, C, A;

String temp = JOptionPane.showInputDialog(null, "Enter the radius of the Circle");

try{

radius = Double.parseDouble(temp);//parse to double

//create the object

Circle1 circle = new Circle1();

//do the calcs

C = circle.circumference(radius);

A = circle.area(radius);

//create the format

NumberFormat f = new DecimalFormat("0.000");

//show the output

JOptionPane.showMessageDialog(null, "The circumference is: " + f.format(C) + " " + "The Area is: " + f.format(A));

}catch(Exception e){

System.out.println("That is not a number");

}

}

Explanation / Answer

online java compiler is at www.vim.org/scripts/script.php?script_id=245;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote