SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 2 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 20 Nov 2017 My Price 8.00

changes to the JAVA code, can anyone help?

I need to assistance making the following changes to the JAVA code, can anyone help?

 

(1) Assignment instruction says, "The setRadius() method not only sets the radius but also calculates the other two values." However, your setRadius() sets only radius, not diameter and area. 

(2) public circle3()

A constructor name is different form the class name. If class name is 'Circle', the constructor name should be 'Circle' too, not 'circle3' - remember that Java is case-sensitive.

(3) Class Circle is a non-static class, so you need a static class for the main program. Without the main program, any non-static class won't be run. So, make a main program (testCircle.java).

 

package circle3;

 

public class circle3 {

 

  private final double PI = 3.14159;

  private double radius;

 

  public circle3() {

    radius = 1.0;

   

      }

 

  

  public circle3(double r) {

    radius = r;

  }

 

  public void setRadius(double r) {

    radius = r;

  }

 

  public double getRadius() {

    return radius;

  }

 

  public double getArea() {

   double area = Math.PI * (radius * radius);

   return area;

  }

 

   

   public double getDiameter() {

    return radius * 2;

  }

 

  public double getCircumference() {

    return 2 * PI * radius;

  }

}

Answers

(5)
Status NEW Posted 20 Nov 2017 08:11 AM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)