Use the testcircle.java program to test your classes

Assignment Help JAVA Programming
Reference no: EM13941308

Using the attached files modify the code to use inheritance, an interface, and aggregation by completing the following steps:

1. In the Shape class, eliminate the concrete methods, area() and perimeter(); create an instance variable of type String called name; and make a constructor that requires a String, shapeName, as the name of the new Shape object. Keep the method getLocation(), and keep the Shape class abstract.

2. Create an interface, Shape2D, which will require the methods, area() and perimeter(), which were elimated from Shape.

3. Create a new class, Point, which inherits from Shape and contains two private instance variables of type int, x and y, which store the coordinates for the Point. Point should have both a default constructor and a constructor that takes two int values for the coordinates x and y. For the default constructor, set both x and y to zero.

4. Modify the class, Circle, to inherit from Shape as well as use the interface, Shape2D. Circle should have only two private instance variables: a double named, radius, and a Point object reference named, center. Circle should have two constructors, a default constructor and a constructor that takes a double as a new radius value and two ints as the x and y coordinates of the center. Circle does not store the x and y values as ints, but instead creates a Point object with these coordinates. The location of a Circle is the location of its center, Point.

5. Use the TestCircle.java program to test your classes until they are error-free .

Attached files:

TestCircle.java
Circle.java
Shape.java

Attachment:- Circle.zip

Reference no: EM13941308

Questions Cloud

What are some of the contributions of the renaissance popes : What are some of the contributions of the "Renaissance Popes"? How did they affect the culture and geography of their time? How did their activities eventually lead to the Protestant reformation?
Tax avoidance as an ethical issue for business : Read the business ethics briefing, Tax Avoidance as an Ethical Issue for Business and answer all parts of the question below. The total word limit is 850.
Why was rome able to maintain an empire : Why was Rome able to maintain an empire that came to dominate the Mediterranean world, whereas the empires that rose in Egypt and Mesopotamia who had more stable and streamlined governments failed to rise to such strength? Be specific in your use ..
Size and extent of conceptual studies : Literature Review comprises the following typical tasks: Conduct a team brainstorming session to scope, the size and extent of conceptual studies needed and agree on strategies to complete the same on time.
Use the testcircle.java program to test your classes : Create a new class, Point, which inherits from Shape and contains two private instance variables of type int, x and y, which store the coordinates for the Point
Nat/pat helped address the ipv4 address : Compare MAC with IPv4 addresses providing an example of each, how those addresses are assigned and what role they play in the operation of a network.
Challenges that the company as well as the government faces : Identify possible constraints and problems that may hinder effective decision making. Explore and discuss the possible constraints or challenges that the company as well as the government faces,
Career development plan and commentary : A personal career development plan and commentary on the challenges you will face in undertaking it.
Most fundamental concepts in the culture : Do you agree with the notion suggested by Lakoff and Johnson that 'the most fundamental values in a culture will be coherent with the metaphorical structure of the most fundamental concepts in the culture'? Illustrate with your own examples where ..

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