The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods are not all correct.
Your job is to go through and fix them. You will need to make edits in both files to get them working correctly, but once complete, your output should match the output below.
Sample Output:
Circle with a radius of 5.0
The diameter is 10.0
The perimeter is 31.41592653589793
CIRCLE.JAVA
public class Circle {
public double radius;
private Circle(double myRadius) {
radius = myRadius;
private void setRadius(int myRadius){
radius = myRadius;
}
private double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
private double getPerimeter() {
return Math.PI*getDiameter();
}
private String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER.JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ.radius = 5;
System.out.println(circ);
System.out.println("The diameter is " + circ.getDiameter());
System.out.println("The perimeter is " + circ.getPerimeter())
}
}

Answers

Answer 1

Answer:

CIRCLE.JAVA

public class Circle {

  private double radius;

  public Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 public double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 public double getPerimeter() {

   return Math.PI*getDiameter();

 }

 public String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

Explanation:

public class Circle {

  //This could be made private or public.

  //Making it private is better

  private double radius;

  //This is a constructor. It should be made public

  //since it would most likely be used in another class

  //to create an object of this class.

  //Making it private means no other external class can create

  //an object of this class.

  //Since the tester class (CIRCLETESTER.java), as shown on line 3,

  // needs to create

  //an object of this class, this should be made public

  public Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 //This should be made public since it will be

// used in another class (CIRCLETESTER.java in this case)

 public double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 //This should be made public since it will be

 //used in another class (CIRCLETESTER.java)

 public double getPerimeter() {

   return Math.PI*getDiameter();

 }

 //The toString() method is the string representation

 //of an object and is called when there is an attempt to

 //print the object. It should be made public since it will

 //be used in another class (CIRCLETESTER.java)

 public String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}


Related Questions

A Process of receiving selecting
organizing interpreting checking and
reacting to sensory stimuli or data
so as to form a meaningful and
coherent picture of the world is
Select one:
a. Attitude
b. Perception
c. Communication
d. Thinking

= Perception​

Answers

Answer:

I think it’s B based on the answer choices

Explanation:

Completing an algorithm means stating the ____ of an algorithm.



(Fill in the blank pls)

WARNING! pls don't do it if you don't want to do it, Don't put an answer that doesn't have anything to do with the question If you do I'll report you full stop!

The reward for answering and correctly :

I will give you the brainiest answer, Mark 5 star, send thanks, put a nice comment and don't forget the points as well!!! ( remember only if it's right!)

THANKS SO MUCH TO ALL!!!​

Answers

Answer:

procedures for calculation

In which type of network will a problem with one computer crash the network?


mesh

ring

star

bus

Answers

Answer:

Probably a mesh since they daisy chain off one another. If one in the middle crashes, there is a disconnect of all the ones following it.

Answer:

bus + ring

Explanation:

edge 2021 :)

sadfsdfsdfasdfsafdsafaf

Answers

Sjciientngjfjrjbshxjejcicknrco

Which results are expected in a personality test but not a skills assessment?

Answers

Answer:

openness, conscientiousness, extraversion

Explanation:

A personality test is defined as a test that is used to assess the human personality. It is designed as the techniques to measure characteristics patterns of the traits that various people shows at different situations or environments.

A skill assessment test is used to test the abilities and the skill sets of people to perform a particular tasks given to them. It is measuring the knowledge and skills of a person.

The personality test are carried out to test how human behave and what traits they show in certain conditions. Thus openness, extra version and conscientiousness are some of the traits that people usually shows in a personality test. Thus they are the results that are expected by an individual of a personality test.

Which function in Excel tells how many numeric entries are ther​

Answers

Answer:The answer is given below:

Explanation:

Count function is used to get the number of entries in Excel.

There is a specific formula for it to count the entries.

The formula is A1:A20: =COUNT(A1:A20.

It is also used to find the data in the following cells.

The values et return to the cell argument.

There can be individual items or in a cluster.

First, we select the blank cell and then use the formula.

Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two values and uses them to initialize the data members.Write a separate function (not part of the Person class) called std_dev that takes as a parameter a list of Person objects (only one parameter: person_list) and returns the standard deviation of all their ages (the population standard deviation that uses a denominator of N, not the sample standard deviation, which uses a different denominator).

Answers

Answer:

class Person(object):

   def __init__(self, name, age):

       self.name = name

       self.age = age

 

def std_dev(person_list):

   average = 0

   for person in person_list:

       average += person.age

   average /= len(person_list)

   total = 0

   for person in person_list:

       total += (person.age - average) ** 2

   return (total / (len(person_list) )) ** 0.5

Explanation:

The class "Person" is a python program class defined to hold data of a person (name and age). The std_dev function accepts a list of Person class instances as an argument and returns the calculated standard deviation of the population.

The divBySum method is intended to return the sum of all the elements in the int array parameter arr that are divisible by the int parameter num. Consider the following examples, in which the array arrcontains {4, 1, 3, 6, 2, 9}.
The call divBySum(arr, 3) will return 18, which is the sum of 3, 6, and 9, since those are the only integers in arr that are divisible by 3.
The call divBySum(arr, 5) will return 0, since none of the integers in arr are divisible by 5.
Complete the divBySum method using an enhanced for loop. Assume that arr is properly declared and initialized. The method must use an enhanced for loop to earn full credit.
/** Returns the sum of all integers in arr that are divisible by num
* Precondition: num > 0
*/
public static int divBySum(int[] arr, int num)

Answers

Answer:

The complete method is as follows:

public static int divBySum(int[] arr, int num){        

     int sum = 0;

     for(int i:arr){

         if(i%num == 0)

         sum+=i;

     }

     return sum;

   }

Explanation:

As instructed, the program assumes that arr has been declared and initialized. So, this solution only completes the divBySum method (the main method is not included)

This line defines the method

public static int divBySum(int[] arr, int num){        

This line declares and initializes sum to 0

     int sum = 0;

This uses for each to iterate through the array elements

     for(int i:arr){

This checks if an array element is divisible by num (the second parameter)

         if(i%num == 0)

If yes, sum is updated

         sum+=i;

     }

This returns the calculated sum

     return sum;

   }

Hydraulic pressure is the same throughout the inside of a set of brake lines. What determines the amount of resulting mechanical
force is the size of the piston in the wheel cylinder or caliper. For example: 100 psi of fluid pressure acting against a caliper piston
with 4 square inches of surface area will result in 400 lbs of clamping force.
A fluid line with 200 psi in it acting against a piston with 3 square inches of area would result in 600 lbs of force.
A fluid line with 50 psi acting on a larger piston with 12 square inches of surface area would result in 600 lbs of force, and so on...
How much fluid pressure would it take to lift a 6000 lb truck on a lift with a 60 quare inch piston (such as on an automotive lift)?
Give your answer and try to justify your answer using an equation or formula.. Pressure x surface area equals mechanical force,
or... force divided by surface area equals fluid pressure

Answers

Answer: 1000 square ponds of force hope you know the answer

Explanation: i guessed

Describe an example of a very poorly implemented database that you've encountered (or read about) that illustrates the potential for really messing things up. Include, in your description, an analysis of what might have caused the problems and potential solutions to them. Be sure to provide citations from the literature.

Answers

I have no clue what you are talking about I am so sorry

Are chairs and tables considered technology?
A) true
B) false

Answers

Answer:true

Explanation:

By definition technology is the skills methods and processes used to achieve goals

Chairs and tables are considered technology. The given statement is True.

A comfortable ergonomic office chair lessens the chronic back, hip, and leg pain brought on by prolonged sitting. Employees are able to operate more effectively and productively as a result. Another advantage is a decrease in medical costs associated with poor posture brought on by uncomfortable workplace chairs.

How does technology make your life comfortable?

They can perform their tasks more easily and independently thanks to technology. They feel more empowered, certain, and positive as a result. Many people can benefit greatly from technology. It goes beyond simply being "cool." The most recent technologies can also simplify life.

Among other major technologies, 3D modeling, virtual reality, augmented reality, and touch commerce has an impact on the design and production of furniture. Before actual furniture is built on the ground, it is possible to virtually create it using 3D or three-dimensional modeling.

Thus, Technology includes things like chairs and tables. The assertion is accurate.

Learn more about technology here:

https://brainly.com/question/9171028

#SPJ2

6. Pattern Displays

Use for loops to construct a program that displays a triangle of Xs on the screen. The

triangle should look like this

X XXXXX

XX XXXX

XXX XXX

XXXX XX

XXXXX X​

Answers

Answer:

public static void displayPattern()

  {

 

      for (int x = 1; x <= 5; x++)

      {

       for (int i = 0; i <= 6; i++)

       {

           if (x == i)

           {

             System.out.print(" ");

           } else {

             System.out.print("X");

           }

       }

       System.out.println("");

      }

     

  }

Don't delete my answer Brainly moderators, you know as well as I do that you'll never be stack overflow so take what you can get.

Write a program that takes a first name as the input, and outputs a welcome message to that name.
Ex: If the input is Pat the output is:
Hello Pat and welcome to cs Online
Input Welcome message
1 user_name = input 2 3
Type your code here

Answers

Answer:

The program in Python is as follows:

user_name = input("Name: ")

print("Hello "+user_name+" and welcome to cs Online")

Explanation:

The program is written in Python, and it uses basic input and output function to execute the instruction in the question.

First: Prompt the user for username

This is done in the following line

user_name = input("Input your name: ")

Next, the print function is used to output the welcome message

print("Hello "+user_name+" and welcome to cs Online")

The program that takes first name as the input, and outputs a welcome message to that name is represented below:

user_input = str(input("please type your first name: "))

print(f" Hello {user_input} !! Welcome to CS online ")

The code is written in python.

The variable user_input is used to store the user's input. It ask the user for his/her first name and store it.

Then we print the welcome statement using the f string.

F-string are use to combine strings and variables.

learn more on python program; https://brainly.com/question/14644566?referrer=searchResults

Write the command and explain about each formula in MS Excel


1. SUM

2. AVERAGE

3. MAx

4. MIN

5. COUNT

Answers

Answer:

Copy the same formula to other cells instead of re-typing it

Simply copy the formula to adjacent cells by dragging the fill handle (a small square at the lower right-hand corner of the cell). To copy the formula to the whole column, position the mouse pointer to the fill handle and double-click the plus sign.

Explanation:

hope its help

Tyrell is required to find current information on the effects of global warming. Which website could he potentially cite as a credible source? Select four options.

a blog by an unknown person that accuses certain companies of contributing to pollution
a nonprofit website that provides information on how to clean up the environment
a recent newspaper article on global warming from a reputable news organization
a government website providing information on national efforts to investigate global warming
a magazine article about climate change in a respected scientific journal

Answers

Answer:

2345

Explanation:

Answer:

✔ a nonprofit website that provides information on how to clean up the environment

✔ a recent newspaper article on global warming from a reputable news organization

✔ a government website providing information on national efforts to investigate global warming

✔ a magazine article about climate change in a respected scientific journal

Explanation:

simplified version: 2345

Choose the type of collection created with each assignment statement. collectionA = {5:2} collectionB = (5,2) collectionC = [5, 2]

Answers

Answer:

CollectionA is Dictionary

CollectionB is List

CollectionC is Tuple

Explanation:

List is recognized by the square brackets

Tuple by the parentheses

Dictionary by the curly brackets

Answer:

Dictionary collectionA

Tuple collectionB

List collectionC

Explanation:

A dictionary uses curly brackets. A tuple uses parentheses. A list uses square brackets.

Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals.

Answers

Answer:

The total cost is $13.0

Explanation:

Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.

Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer's video rentals.

The program should prompt the user for the number of each type of video and output the total cost.

Intrusion Detection System (IDS) is a security mechanism that detects unauthorized user activities, attacks, and network compromises.

a. True
b. False

Answers

Answer: True

Explanation:

The Intrusion Detection System (IDS) is used for the detection of malicious activities and thus is done by monitoring if the network communications and also the examination of systems logs.

When something looks suspicious of fishy, the Intrusion Detection System scans such thing out. When violations of policy occurs, the Intrusion Detection System is at alert to notice.

Therefore, the answer to the statement in the question is true.

An object's state is defined by the object's
methods and instance variables
instance variables and their values
access modifiers of the instance variables
O
methods and their return values

Answers

Answer:

The right answer is option 2: instance variables and their values

Explanation:

Let us define what an object is.

An object is a blueprint of a real-world identity. The instances are the reference to the object. Multiple instances of an object type can be made.

The instance variables and their values help us to determine the state of the object.

Hence,

The right answer is option 2: instance variables and their values

System software is software that allows users to do things like create text documents, play games, listen to music or web browsers to surf the web. True or False
O True
O False

Answers

Answer:

False

Explanation:

System software is the collection of programs that controls and manage the operation of a computer.

System software is software that allows users to do things like create text documents, play games, listen to music or web browsers to surf the web is a false statement.

What is the software about?

A system software is made up of software development tools but software that gives room for users to create text documents, play games, listen to music, or others are known to be application software.

Therefore, System software is software that allows users to do things like create text documents, play games, listen to music or web browsers to surf the web is a false statement.

Learn more about System software from

https://brainly.com/question/24321656

#SPJ6

What is the next line? >>> tupleB = (5, 7, 5, 10, 2, 7) >>> tupleB.count(7) 1 0 5 2

Answers

Answer:

The right answer is option 4: 2

Explanation:

Lists are used in Python to store elements of same or different data types.

Different functions are used in Python on List. One of them is count.

Count is used to count how many times a specific value occurs in a list.

The syntax for count is:

listname.count(value)

In the given code,

The output will be 2

Hence,

The right answer is option 4: 2

Answer:

The answer is 2!!!!

Explanation:

Good luck!

What is the software of Apple

Answers

IOS
I hope it’s correct :)

Exercise 1.3.5: Expressing conditional statements in English using logic. info About Define the following propositions: c: I will return to college. j: I will get a job. Translate the following English sentences into logical expressions using the definitions above: (a) Not getting a job is a sufficient condition for me to return to college. (b) If I return to college, then I won't get a job. (c) I am not getting a job, but I am still not returning to college. (d) I will return to college only if I won't get a job. (e) There's no way I am returning to college. (f) I will get a job and return to college..

Answers

hope this helps!!!. i worked hat

Conside following prototype of a function
int minArray(int [], int );
Which of the option is correct way of function CALL assuming following arraydeclaration
int x[5] = {7,4,6,2,3};*
a) minArray(x,5);
b) minArray(x[],10);
c) minArray(x[5],5);
d) minArray(5,x);

Answers

Answer:

The answer is "Option a"

Explanation:

Following are the code to this question:

#include <stdio.h>//header file

int minArray(int x[], int n)//defining method minArray that accepts two parameters

{

   for(int i=0;i<n;i++)//defining loop for print value

   {

    printf("%d\n",x[i]);//printf array value

   }

}

int main()//defining main method

{

int x[] ={7,4,6,2,3};//defining array that hold values

int n=5;//defining integer variable

minArray(x,5);//calling method minArray

return 0;

}

In this code, a method "minArray" is defined, that accepts two parameters array and an integer variable in its parameter, and in the next step, the for loop is declared, that uses the print method to prints its value.

In the next step, the main method is declared, which declared an array and holds its values and defines an integer variables, and calls the method "minArray".

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between (and including) 0 and 9. End with a newline. Ex:
5.
7.
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
1 #include
2 #include //
3 Enables use of rand ()
4 int main(void) ( int seedval;
6.
7. scanf ("%d", &seedval);
8.
9.
10 srand(int seedval);
11 printf("%d\n", srand());
12 printf("%d\n", srand());
13
14 return e;
15 }

Answers

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

If an ISP assigned you a /28 IPv6 address block, how many computers could be as- signed an address from the block?

Answers

Answer:

I think 14 hosts (computer)

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumber and allow the user to continually input numbers until they correctly guess what secretNumber is. Complete the method guessMyNumber that uses a while loop to ask the user for their guess and compares it againist secretNumber. For example, if secretNumber was 6, an example run of the program may look like this:_______.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

Ways information technology does not make us productive

Answers

Answer:

Although technology is moving the limits, its power is not always helpful.

Explanation:

Technology can make us very non-productive, as it takes time away from our most productive hours when we use our productive time to scroll social media.

Notifications can interrupt the concentration. It makes us lazy in the morning, when, instead of being productive, we are reading anything online.

It can impact our sleep, anxiety, and it may force us to spend time creating a false image of ourselves.

Your task is to implement a function replace_once(t, d), that takes a text t and a replacement dictionary d, and returns the result of replacing words according to the dictionary: if a word appears as a key, replace it with the dictionary value, and if a word does not appear in the dictionary, leave it alone.

Given a list of words, you can concatenate them together with spaces in between as follows:
word_list = "I love eating bananas".split()
print("Word list:", word_list)
back_together = " ".join(word_list)
print("Back together:", back_together)
# You can also join them in other ways, btw. Just DON'T do it for this homework.
print("You can also put commas:", ", ".join(word_list))

Answers

Answer:

Explanation:

The following code is written in Python and does exactly as requested. It is a function named replace_one(t, d) that takes the two parameters one text/word and one dictionary. If the word is found as a key in the dictionary it places the value in a variable called new_word and returns it to the user, if it is not found then the function returns nothing.

def replace_once(t, d):

   if t in d:

       new_word = d.get(t)

       return new_word

   return

Assume that you are asked to develop a C++ program that help an elementary school teacher to

calculate his students total and average score of the following five courses ( Amharic, English,

Mathematics, Science and Sport). The program should ask the teacher to enter all subject scores

from the key board and the output of the program looks like:

***********************************

Amharic…………………………………67

************************************

English………………………………….76

************************************

Mathematics ……………………………78

************************************

Science ………………………………….87





please answer it

************************************
Sport…………………………………….89

************************************

Total ………………………………….397

************************************

Average …………………………….79.4

************************************

Answers

answer:7375

-_--_-_-_-_-_-_-$-$-

Other Questions
Mr. Vedra deposited $1,200 in a certificate of deposit (CD) at an interest rate of 5.5%. He earned $198 in simple interest. How long was the CD for? Read the passage on the left to answer the following questions:1) Which is the main theme of the passage?A) Finding a career is difficult.B) Animal conservation is important.C) People often harm the environment.D) Mistakes of the past can be corrected. Use the given cost table for the same product from two different companies to create a linear systThen solve the system to determine when the cost of the product will be the same and what thebe.Two online retailers sell organic vanilla extract by the ounce using the following pricing chart.Vanilla Extract (oz)Chef Matec)Grocery Gourmetgla)2$13.50$24.003$18.25$28.004$23.00$32.005$27.75$36.00gin)Both Chef Mate and Grocery Gourmet chargesforounces of vanilla extract. State if the two triangles are congruent. If so, state how you know. DUE TODAY 30 POINTS EASY!!Systems of linear equations in two variables with exactly one solution must have _____. A. The same slope B. Different slopes C. Same y intercepts C. Different y intercepts HELP PLEASE.ALGEBRA. Please hurry I need help fast Select the correct answer.What conflict is the narrator facing in this excerpt from Robert Cormier's "The Moustachen? Please help! Ill mark you as brainliest if correct A breakfast diner ordered milk with 1.5% fat but 30 liters of milk with 5% fat were delivered. How many liters of milk with 0% fat should the waitress add to the delivery to get milk with 1.5% fat? The late cab Raj waited the was for but late...(.Arranging plss) 275L/sec to mL/hour with work Qu plato de El mundo hispano debe elegir una persona vegetariana? Which would be an autotroph in a grassland ecosystem Give two consequences of the California Gold Rush 1849 (8 marks) This isn't really relating to sports homework or anything but rather math. Could the amount of yards lost in a football game be a fraction? Thank you. Where did the first battles of the American revolution take place? people are in a pool drowning 1. your wife2. 5 millon dolors 3 your who do you save In one complete sentence in Spanish state a place you went in the past using correct form of the verb ir in the preterite tense in another complete sentence in Spanish state a place someone else (your friend parents, etc.) went in the past using the correct form of the verb ir in the preterite tense. Look in the document