1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lunna [17]
3 years ago
7

Create a class named Circle with fields named radius, diameter, and area. Include a constructor that sets the radius to 1 and ca

lculates the other two values. Also include methods named setRadius() and getRadius(). The setRadius() method not only sets the radius, but it also calculates the other two values. (The diameter of a circle is twice the radius, and the area of a circle is pi multiplied by the square of the radius. Use the Math class PI constant for this calculation.) Save the class as Circle.java.
Computers and Technology
1 answer:
REY [17]3 years ago
6 0

Answer:

The code for this class is shown in the explanation section

Explanation:

public class Circle {

   private double radius;

   private double diameter;

   private double area;

   public Circle(double radius, double diameter, double area) {

       this.radius = 1;

       this.diameter = diameter;

       this.area = area;

   }

   public void setRadius(double radius) {

       this.radius = radius;

       diameter = radius*2;

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

   }

   public double getRadius() {

       return radius;

   }

}

You might be interested in
How do you know when a spreadsheet object is active in a powerpoint presentation?
Ira Lisetskai [31]
It should be under lined, when you press it it should have a different colour
4 0
3 years ago
If not cleared out, log files can eventually consume a large amount of data, sometimes filling a drive to its capacity. If the l
OLEGan [10]

Answer:

<u>/var</u>

Explanation:

The /var subdirectory contains files to which the system writes data during the course of its operation. Hence, since it serves as a system directory, it would prevent log files from consuming a large amount of data.

7 0
2 years ago
Read 2 more answers
Please help me with these two questions! 60 points!
RUDIKE [14]

Answer:

Networks prevent unauthorized access to data and protect equipment. Networked computers are less likely than single computers to suffer equipment failure. Networks allow computers to connect quickly and to share data or equipment.

Explanation:

3 0
2 years ago
Which item converts a high level language program to low level machine instruction?
vodomira [7]
The compiler translates each source code instruction into the appropriate machine language instruction, an
8 0
3 years ago
I. A teacher can prepare a slide and demonstrate it in the class with the help
marin [14]

Answer:

ay di ko alam yan hahahaha

3 0
2 years ago
Other questions:
  • Which of these is NOT an advantage of the impact of computer careers.
    9·1 answer
  • How do media and networks interact
    11·1 answer
  • In steps<br> Urgent please
    14·1 answer
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • Which is the last step in conducting a URL search?
    14·2 answers
  • Hello help me with this please if you want to thank you I would give brainlist!
    13·2 answers
  • Create an online order form for a car rental store and include the following items: input text box to enter the number of days i
    14·1 answer
  • How to write my name in binary code ? Rivas
    7·2 answers
  • Write any two disadvantage of First generations computers​
    14·1 answer
  • Please help me answering this question
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!