2.99 See Answer

Question: Consider the following class declaration: public


Consider the following class declaration:
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;
}
}
1. Write a toString method for this class. The method should return a string containing the radius and area of the circle.
2. Write an equals method for this class. The method should accept a Circle object as an argument. It should return true if the argument object contains the same data as the calling object, or false otherwise.
3. Write a greaterThan method for this class. The method should accept a Circle 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.


> Look at the following SQL statement. SELECT Id FROM Account What is the name of the table from which this statement is retrieving data? What is the name of the column that is being retrieved?

> What is a ResultSet object?

> What Java data types correspond with the following SQL types? - INTEGER - INT - REAL - CHARACTER - VARCHAR - DOUBLE

> Why do most businesses use a DBMS to store their data instead of creating their own text files or binary files to hold the data?

> How do you change the background color of a component? How do you change the color of text displayed by a label or a button?

> Write a method that accepts a reference to a String object as an argument and returns true if the argument ends with the substring “.comâ€. Otherwise, the method should return false.

> How do you register an event listener with a JButton component?

> If you are writing an event listener class for a JButton component, what interface must the class implement? What method must the class have? When is this method executed?

> What is an event listener?

> What is the difference between a frame and a panel?

> What is a content pane?

> How do you display a frame on the screen?

> What is the preferred way of creating a Border object?

> What method do you use to set a border around a component?

> How do you determine in code whether a check box is selected?

> How do you determine in code whether a radio button is selected?

> Write a loop that counts the number of digits that appear in the String object str.

> What type of event does a check box generate when the user clicks on it?

> What type of event does a radio button generate when the user clicks on it?

> Do you normally add radio buttons, check boxes, or both to a ButtonGroup object?

> What is the purpose of a ButtonGroup object?

> How do you set a frame’s size?

> You want the user to be able to select any number of items from a group of items. Which type of component would you use for the items, radio buttons or check boxes?

> You want the user to be able to select only one item from a group of items. Which type of component would you use for the items, radio buttons or check boxes?

> What is the default layout manager for a JFrame object’s content pane? For a JPanel object?

> How can you cause a content pane to be automatically sized to accommodate the components contained within it?

> How do you prevent the BorderLayout manager from resizing a component that has been placed in its region?

> The following if statement determines whether choice is equal to ‘Y’ or ‘y’: if (choice == 'Y' || choice == 'y') Rewrite this statement so it makes only one comparison and does not use the || operator. (Hint: Use either the toUpperCase or toLower

> How many components can you have at one time in a BorderLayout region? In a GridLayout cell?

> Which layout manager arranges components in rows and columns?

> Which layout manager arranges components in a row, from left to right, in the order they were added to the container?

> Which layout manager divides a container into regions known as north, south, east, west, and center?

> How do you add a layout manager to a container?

> What is a frame? How do you create a frame with Swing?

> What is direct recursion? What is indirect recursion?

> What causes a recursive algorithm to stop calling itself?

> What is a recursive case?

> What is a base case?

> A pet store sells dogs, cats, birds, and hamsters. Write a declaration for an enumerated data type that can represent the types of pets the store sells.

> It is said that a recursive algorithm has more overhead than an iterative algorithm. What does this mean?

> What shape method do you call to rotate a shape around its center?

> What shape method do you call to change a shape’s fill color?

> What shape method do you call to change the color of a shape’s outline?

> In what package is the Pane class?

> In what package is the Color class?

> Refer to your answer for Checkpoint14.41 . What does the method return? Data from Checkpoint 14.41: What KeyEvent method can you call to determine which key the user pressed?

> What KeyEvent method can you call to determine which key the user pressed?

> What type of event happens when the user presses and releases a key that produces a Unicode character?

> In what package is the Shape class?

> What type of event happens when the user releases a key on the keyboard?

> What type of event happens when the user presses a key on the keyboard?

> How do you set the size of a video’s viewing window?

> In what package are the three classes?

> What three classes do you use to play a video file?

> What does the MediaPlayer method setCycleCount do?

> What does the MediaPlayer method setAutoPlay do?

> Refer to your answer to Checkpoint14.31 . In what package are the two classes? Data from Checkpoint 14.31: What two classes do you use to play an audio file?

> What two classes do you use to play an audio file?

> If you want to combine multiple effects on a single node, which Node class method would you use to set the effect?

> The values variable references a two-dimensional double array with 10 rows and 20 columns. Write code that sums all the elements in the array and stores the sum in the variable total.

> Write assignment statements that perform the following operations with the variables a, b, and c. 1. Adds 2 to a and stores the result in b 2. Multiplies b times 4 and stores the result in a 3. Divides a by 3.14 and stores the result in b 4. Subtracts 8

> How is the screen coordinate system different from the Cartesian coordinate system?

> Which effect class do you use to create a reflection of a node?

> Which effect class do you use to create a glowing effect?

> Which effect class do you use to create an antique sepia tone effect?

> What three effect classes can you use to create blur effects?

> Which effect class do you use to adjust an image’s hue, saturation, brightness, and contrast?

> Which effect class do you use to create a shadow inside the edges of a node?

> Which effect class do you use to create a drop shadow?

> In what package are the effect classes?

> How can you change an animation’s interpolator?

> Write code that calculates the average of all the elements in the grades array that you declared in Question 6. Data from Question 6: Declare a two-dimensional int array named grades. It should have 30 rows and 10 columns.

> In what package is the Duration class?

> In a window 640 pixels wide by 480 pixels high, what are the coordinates of the pixel in the lower-right corner?

> How do you specify the amount of time that an animation should last?

> Which transition class causes a node to fade?

> Which transition class causes a node’s fill color to change?

> Which transition class causes a node’s stroke color to change?

> Which transition class causes a node to become larger or smaller?

> Which transition class causes a node to rotate?

> Which transition class causes a node to move from one position on the screen to another?

> Which of the following is not a subclass of the Shape class? 1. Circle 2. Rectangle 3. Triangle 4. Ellipse

> In a program you need to store the identification numbers of ten employees (as int values) and their weekly gross pay (as double values). 1. Define two arrays that may be used in parallel to store the 10 employee identification numbers and gross pay amou

> What shape method do you call to scale a shape along the Y axis?

> What shape method do you call to scale a shape along the X axis?

> What are the coordinates of the pixel in the upper-left corner of the window?

> When speaking of colors, what does RGB mean?

> If a style definition for a specific type of node contradicts a style rule in the .root definition, which takes precedence—the more specific style definition, or the .root definition?

> If you want to apply styles to all of the nodes in a scene, what selector would you use in a style definition?

> Assume scene is the name of a Scene object, and stylesheet.css is the name of a CSS stylesheet. Write the statement that applies the stylesheet.css stylesheet to scene.

> If you want to place a dotted border around a Label control, which CSS style property would you set?

> How do you determine the file that the user selected with either an open dialog or a save dialog?

> How do you display a save dialog?

> 1. Write a statement that declares a String array initialized with the following strings: “Einsteinâ€, “Newtonâ€, “Copernicusâ€, and “Keplerâ€. 2. Write a loop that displays the contents of each element in the array that you declared in Question

> How do you display an open dialog?

> In what package is the FileChooser class?

> What type of event do menu items generate when selected by the user?

> What class do you use to create a check menu item? How do you cause it to be initially selected?

> How do you create a relationship between radio menu items so only one may be selected at a time?

> What class do you use to create a radio menu item? How do you cause it to be initially selected?

2.99

See Answer