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
Reika [66]
3 years ago
8

The calcCircleCircumf() method invoked within in the CircleStatsTester class is overloaded. Write the overloaded methods in the

incomplete public CircleStats class.
public class CircleStats
{
public CircleStats()
{
}

//…code goes here — use the Math constant for pi rather than 3.14
}

public class CircleStatsTester
{
public static void main(String[] args)
{

int diameter = 5;
double radius = 2.5;
CircleStats cStats = new CircleStats();

System.out.println("The circumference = " + cStats.calcCircleCircumf(diameter));
System.out.println("The circumference = " + cStats.calcCircleCircumf(radius));

}
}
Computers and Technology
1 answer:
solong [7]3 years ago
7 0

Answer:

The program to this question as follows:

Program:

class CircleStats //defining class  

{

CircleStats() //creating default constructor

{

}

float calcCircleCircumf(float radius) //defining method  

{

   return (float)(2 * Math.PI * radius); //return value

}

double calcCircleCircumf(double diameter) //overload the method

{

   return (2 * Math.PI * (diameter/2)); //return value

}

}

public class CircleStatsTester //defining class  

{

public static void main(String ar[]) //defining main method  

{

int diameter = 5; //defining integer variable

double radius = 2.5;//defining float variable

CircleStats cStats = new CircleStats(); //creating CircleStats class object

System.out.println("The circumference = " + cStats.calcCircleCircumf(diameter)); //print value

System.out.println("The circumference = " + cStats.calcCircleCircumf(radius));  //print value

}

}

Output:

The circumference = 31.4

The circumference = 7.853981633974483

Explanation:

In the above java program code, two-class is declared that are "CircleStats and CircleStatsTester". In the class "CircleStats" a default constructor is created then method overloading is performed in which two method is defined that have the same name but different parameters.

  • In the first-time method declaration, it contains a float variable "radius" in its parameter to calculate and return its value.
  • In the second time method declaration, it contains a double variable "diameter" in its parameter, calculates and returns its value.

Then another class CircleStatsTester is defined inside this class the main method is defined. In the main method, an integer and double type variable is defined that contains a value that is "diameter = 5 and radius = 2.5". In this method, an above class CircleStats object is created and call this class functions.

You might be interested in
How to tell what wifi your nest camera is connected to
daser333 [38]

Answer:

On the app home screen, tap Settings .

Select Home info then Home Wi-Fi help. ​Note: If you don't find Home Wi-Fi help, you'll need to remove your camera from the app and add it back with new Wi-Fi information.

Select the camera you want to update.

Tap Start. Update settings.

6 0
3 years ago
Read 2 more answers
9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
tatuchka [14]

Answer:

True

Explanation:

It is known as Don-Not-Carry rules are implemmented to avoid

-Unauthorized full disk copies (it have been made while the laptop owner was out of the hotel room on overseas travel)

-Laptops steals

- Monitoring by third parties of wireless using.

3 0
3 years ago
If you were at the front of a long line of people, stepped onto a chair and took a
WINSTONCH [101]
They are closer to the people and they work than a senior management
7 0
3 years ago
Nominal data: are ranked according to some relationship to one another. have constant differences between observations. are sort
WINSTONCH [101]

COMPLETE QUESTION:

Nominal data:

A) are ranked according to some relationship to one another.

B) have constant differences between observations.

C) are sorted into categories according to specified characteristics.

D) are continuous and have a natural zero.

Answer:

C) Are sorted into categories according to specified characteristics.

Explanation:

Nominal data is defined in statistics as that data that are 'named' or 'labelled'. Data values therefore belong to different groups with unique labels with each group associated with specified characteristics.

6 0
3 years ago
Biomass technology releases stored energy from the sun.
just olya [345]

Answer:

this is not true this is not true

7 0
3 years ago
Other questions:
  • Liz's meeting is scheduled to end at 9:30. It is 9:20 and team
    11·1 answer
  • ?What protocol is used to provide a common language between virtualized service applications and a network's physical devices?
    10·1 answer
  • A _____________ is some text or data that is stored on your computer and used by a website to track how you use that site. quest
    8·2 answers
  • Introduction to graphic design please help! Define the four terms: design ,art,decoration , and visual literacy. Describe how th
    12·1 answer
  • I need help making this table in html code I have some of chart done but idk where to go after the 6:30pm part
    13·1 answer
  • Ahem, so basically I added a extension on my SCHOOL chromebook, and I want to get rid of it because it keeps opening extra tabs
    5·1 answer
  • How have newspapers and magazines adapted to digital technology?
    14·1 answer
  • PLEASE HELP!!! NO LINKS!! I'LL GIVE BRAINLIEST!!
    12·2 answers
  • What are tasks performed by pascaline?​
    8·1 answer
  • PLS HELP subject (Microsoft Excel ) True or False:
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!