Define a static max method in the geometricobject class

Assignment Help JAVA Programming
Reference no: EM13782345

Instructions: Properly indent your code and include appropriate comments. Follow instructions given for each problem in the textbook.

Required

EnableGeometricObject comparable

Modify the GeometricObject class to implement the Comparable interface, and define a static max method in the GeometricObject class for finding the larger of two GeometricObject objects. Use the provied UML diagram and implement the new GeometricObject1, Circle1, and Rectangel1 classes. Write a test program that uses the max method to find the larger of two circles and the larger of two rectangles.
Sample main provided.

*Hint create a new GeometricObject class called GeometricObject1 which will implement Comparable.

abstract class GeometricObject1 implements Comparable<GeometricObject1>

GeommetricObject1 will need to have a compareTo method and the method
public static GeometricObject1 max(GeometricObject1 o1,GeometricObject1 o2)

{

which will use the compareTo method to return the relationship between o1 and o2, the value, 0,1, or -1.

You will also need a class Circle1 that extends GeometricObject1.

class Circle1 extends GeometricObject1

{

You will also need a class Rectangle1 that extends GeometricObject1.

classRectangle1 extends GeometricObject1

{

Classes GeometricObject, Circle and Rectangle have been provided for you as a starting point.

Reference no: EM13782345

Questions Cloud

Calculate the inventory carrying cost associated : Helter Industries, a company that produces a line of women's bathing suits, hires temporaries to help produce its summer product demand. For the current four-month rolling schedule, there are three temps on staff and 12 full-time employees. The temps..
The financial performance and condition of the organization : Choose three or four areas from your SWOT analysis and explain why the areas you have chosen are essential to your strategic plan.
Specify optimal strategy-expected profit that strategy : Entering international markets has become a priority for many companies even in the US, which has a large domestic market? Is having a strategic alliance with foreign companies a better alternative to simply appointing distributors and dealers abroad..
Where do you stand on this issue : Some courts hold that an engagement ring is a conditional gift that becomes an absolute (effective) gift only on marriage. Other courts conclude that when an engagement ring is given to the donee, the donee should have full ownership rights in the..
Define a static max method in the geometricobject class : Modify the GeometricObject class to implement the Comparable interface, and define a static max method in the GeometricObject class for finding the larger of two GeometricObject objects
Explore the effects of carters language on readers familiar : Explore the effects of Carter's language on readers familiar with other versions of the story. How do you respond to her representation of the father?
Ethical alternatives for resolving this dilemma : How might Irina's age and parents' involvement in the referral affect how Dr. Matthews can resolve the dilemma? How might the state law on treatment of minors and HIPAA rule on access of guardians to a minor's health care record influence Dr. Matt..
Barbara is considering investing in a stock and is aware tha : 1.) Barbara is considering investing in a stock and is aware that the return on that investment is particularly sensitive to how the economy is performing. Her analysis suggests that four states of the economy can affect the return on the investment...
Simply appointing distributors and dealers abroad : Entering international markets has become a priority for many companies even in the US, which has a large domestic market? Is having a strategic alliance with foreign companies a better alternative to simply appointing distributors and dealers abroad..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd