Write a method called floatEquals that accepts three floating-point values as parameters. The method should return true if the first two parameters are equal within the tolerance of the third parameter.

What will be an ideal response?

```
public boolean floatEquals(double float1, double float2,
double tolerance)
{
return (Math.abs(float1 - float2) <= tolerance);
}

```

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. Multiple public: and private: sections are prohibited in a class. 2. A sure test of whether you have succeeded in producing an Abstract Data Type (whether you have truly separated the interface from the implementation) is whether you can use the ADT then change either the implementation or the client code without being required to change the other. 3.The scope resolution operator can be used with an object to qualify a member function. 4. The dot operator is used between an object and a data member or between a calling object and a call to a member function from the class of the object.

Computer Science & Information Technology

You have decided that you will design a title so that it looks good in any screen resolution from 640x480 to 1024x768. You want the heading to be dramatic, which you have decided means as big as possible without it breaking into two lines on a small screen. The title is “Typography is Fun!” Create a Web page with several versions of the title, each using a different typeface. Use at least different three different typefaces. For each version, specify the typeface and size for the font. Note: there is no unique “correct” answer. Restrict yourself to the typefaces described in this chapter.

What will be an ideal response?

Computer Science & Information Technology