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
Evgesh-ka [11]
3 years ago
10

. Write a toString method for this class. The method should return a string containing the base, height and area of the triangle

. b. Write an equals method for this class. The method should accept a Triangle object as an argument. It should return true if the argument object contains the same data as the calling object, or false otherwise. c. Write a greaterThan method for this class. The method should accept a Triangle object as an argument. It should return true if the argument object has an area that is greater than the area of the calling object, or false otherwise.
Computers and Technology
1 answer:
marta [7]3 years ago
7 0

Answer:

Check the explanation

Explanation:

Circle.java

public class Circle {

private double radius;

public Circle(double r) {

radius = r;

}

public double getArea() {

return Math.PI * radius * radius;

}

public double getRadius() {

return radius;

}

public String toString() {

String str;

str = "Radius: " + radius + "Area: " + getArea();

return str;

}

public boolean equals(Circle c) {

boolean status;

if (c.getRadius() == radius)

status = true;

else

status = false;

return status;

}

public boolean greaterThan(Circle c) {

boolean status;

if (c.getArea() > getArea())

status = true;

else

status = false;

return status;

}

}

I have created a class also to test this class below is the class: -

MainCircle.java

public class MainCircle {

public static void main(String args[]) {

Circle c = new Circle(2.5);

Circle c1 = new Circle(2.5);

Circle c2 = new Circle(4.5);

System.out.println(c);

System.out.println(c1);

System.out.println(c2);

System.out.println("Is c and c1 equal : "+c.equals(c1));

System.out.println("Is c2 greater than c1 : "+c1.greaterThan(c2));

}

}

Output: -

Radius: 2.5Area: 19.634954084936208

Radius: 2.5Area: 19.634954084936208

Radius: 4.5Area: 63.61725123519331

Is c and c1 equal : true

Is c2 greater than c1 : true

You might be interested in
It is possible to make the document larger for viewing small text. <br> True or False
kirill [66]
I believe your answer is true
5 0
4 years ago
Read 2 more answers
Describe how web caching can reduced the delay in receiving a requested object .Will web caching reduce the delay for all object
nydimaria [60]

Answer:

Web caching can bring the desired content "closer" to the user, perhaps to the same LAN to which the user's host is connected. Web caching can reduce the delay for all objects, even objects that are not cached, since caching reduces the traffic on links

Explanation:

8 0
3 years ago
Gina is using Outlook in the default cached mode and is connected to an Exchange server. What is the default file type used to s
ser-zykov [4K]

Answer:

Its C. MSG

Explanation:

On edg

5 0
3 years ago
Is there an air flow through the house? if so, does the air flow in the window and out the chimney, or in the chimney and out th
soldier1979 [14.2K]

The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

<h3>What is the main purpose of chimney?</h3>

The primary work of the chimney is to show the way that the smoke need to take away from the stove and also out of the house.

Hence, The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

Learn more about chimney from

brainly.com/question/24792291

#SPJ1

See full question below

Is there an air flow through the house? If so, does the air flow in the window and out the chimney, or in the chimney and out the window? Choose the correct explanations.

A. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

C. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

D. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

E. The pressures at the chimney and the window are the same. Thus, the air will not flow.

5 0
2 years ago
Create a new program in python that:
LiRa [457]

Answer:

here

Explanation:

If you want to display something on screen you can use the print() function. ... An example of code that will ask the user to enter their name and display it on ... stores it in a variable called city city = input("What is the capital city of England ... If you want to perform a format check in Python you will need to make use of a library.

6 0
3 years ago
Other questions:
  • What is a partition gap, and how might it be used to hide data?â?
    8·2 answers
  • You should use a ____ chart to compare values side by side, broken down by category.
    9·1 answer
  • Given this method comment, fill in the blank in the method implementation. /* Deposits money into the bank account amount: the a
    6·1 answer
  • The _____ row is typically the first row in a table.<br><br> banded<br> total<br> header<br> odd
    14·2 answers
  • Which of the following statements is true of algorithms?
    15·1 answer
  • Linux implements _________ to determine how a user is to be authenticated and whether there are password policies associated wit
    11·1 answer
  • There are spoilers that doctor brenner is back in stranger things four and eleven is going back. Do you believe it or no? Make s
    12·1 answer
  • 2. The Warren Commission investigated the assassination of President _______________________ in 1964.
    6·1 answer
  • ...............is a personal computer that fits on desk.​
    5·2 answers
  • When creating a report,you can mske groups and subgroups by?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!