Implement all constructors and the specified methods of Circle Class based on the following UML class...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Implement all constructors and the specified methods of Circle Class based on the following UML class diagram. Perimeter=2*Pl*radius. Circle -double x -double y -double radius %Default constructor. Initalise x, y by 0, radius by 1% +Circle() %Initalise x, y by 0, and radius by the given value% +Circle(double radius) %Copy constructor. Initalise x, y, radius by the given circle object% +Circle(Circle circle) %Initalise radius by 1 and x, y by the given values% +Circle(double x, double y) %Initalise x, y, radius by the given values% +Circle(double x, double y, double radius) +getX() double +getY() double +getRadius():double +getPerimeter():double 1 public class Circle{ private double x,y, radius; public Circle() { 2 3 4 ▾ 5 6 } 7 8 9 10 } 11 12▾ 13 14 } 15 16▼ 17 18 } 19 20▾ 21 public Circle (double radius) { public Circle (Circle circle) { public Circle(double x, double y){ 24▾ public Circle(double x, double y, double radius){ } public double getX() { return x; 33 222222222222-23456789 30 } 31 } public double getY() { return y; 32▾ public double getRadius(){ return radius; 36▾ } } } public double getPerimeter(){ return Math. PI*2*radius; Implement all constructors and the specified methods of Circle Class based on the following UML class diagram. Perimeter=2*Pl*radius. Circle -double x -double y -double radius %Default constructor. Initalise x, y by 0, radius by 1% +Circle() %Initalise x, y by 0, and radius by the given value% +Circle(double radius) %Copy constructor. Initalise x, y, radius by the given circle object% +Circle(Circle circle) %Initalise radius by 1 and x, y by the given values% +Circle(double x, double y) %Initalise x, y, radius by the given values% +Circle(double x, double y, double radius) +getX() double +getY() double +getRadius():double +getPerimeter():double 1 public class Circle{ private double x,y, radius; public Circle() { 2 3 4 ▾ 5 6 } 7 8 9 10 } 11 12▾ 13 14 } 15 16▼ 17 18 } 19 20▾ 21 public Circle (double radius) { public Circle (Circle circle) { public Circle(double x, double y){ 24▾ public Circle(double x, double y, double radius){ } public double getX() { return x; 33 222222222222-23456789 30 } 31 } public double getY() { return y; 32▾ public double getRadius(){ return radius; 36▾ } } } public double getPerimeter(){ return Math. PI*2*radius;
Expert Answer:
Answer rating: 100% (QA)
Answer Here is the code public class Circle instance variables private double x private double y pri... View the full answer
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Compute the thrust required for take-off for a 3-spool turbofan given the following data: a) Flight conditions: M = 0.2, T = 288 K, P = 1 bar b) cH = 5, = 0.98, T = 5, f = 0.0177, hp = 45000 kJ/kg...
-
Svengool Inc. financial statements included the following amounts for the current year: Retired bonds $67,000 30,000 Proceeds from collection of note receivable Dividends received 11,000 Acquired...
-
If a bank has $100 million in deposits and $18 million in reserves with a reserve requirement of 0.15, 1. How much are its required reserves? 2. How much excess reserves does it have? 3. How much can...
-
Find the area of ABC if C = 106.4, a = 7 cm, and b = 13 cm.
-
When conducting an incremental analysis, what step must always be taken immediately prior to beginning the pairwise comparisons? a. Order the alternatives from highest to lowest initial investment b....
-
Gunn Manufacturing Company experienced the following accounting events during its first year of operation. With the exception of the adjusting entries for depreciation, assume that all transactions...
-
Find an application of OLAP (online analytical processing) for FIU. How can FIU use multidimensional analytical queries to generate BI? Some examples?
-
Jones Contractors Inc. agreed to construct a building for 5300,000. Construction commenced in 2011 and was completed in 2013. Data relating to the contract are summarized below: Required: a. For each...
-
The following procedures pertain to the production process. For each of them: (a) Identify the control objective (b) Suggest an example deviation 1) Obtain a sample of closed production cost sheets....
-
3. (a) What magnitude of magnetic field would make a beam of electrons, traveling to the right of this page at a speed of 4.8x106 m/s, go undeflected through a region where there is a uniform...
-
Write a few sentences about C# or Project Management. Did you learn anything new when researching these topics? Did you find a helpful site or article that you can share with class? Second Post:...
-
Conduct stock valuations for Tesla using a set of techniques such as the Single-Index market model and Discounted Dividend Model (DDM). Single-Index Market Model: The Single-Index market model is a...
-
Given the lines: and r = (4, -2, -3) + t(1, 5, 2) 1-2-9-5-2+1 y 3 -4 2 a) Determine if the lines are parallel or not. Explain your answer. b) Find the intersection of the two lines (if possible). c)...
-
Discuss the coverage of 5G technology by the leading telcos in Australia and their plans for future coverage. Can 5G technology help Australian businesses and services to increase efficiency and...
-
Post closing entries and complete the closing process. (For accounts that have zero ending balance, the entry should be the balance date and zero for the amount. Post entries in the order of journal...
-
5. Convert the following ERD to a relational model. SEATING RTABLE Seating ID Nbr of Guests Start TimeDate End TimeDate RTable Nbr RTable Nbr of Seats RTable Rating Uses EMPLOYEE Employee ID Emp...
-
Suppose the database contains a student table defined as follows: A full name is in the form of firstname mi lastname or firstname lastname. For example, John K Smith is a full name. Write a program...
-
Write two programs, such that one displays the mouse position when the mouse button is clicked (see Figure 15.28a), and the other displays the mouse position when the mouse button is pressed and...
-
Write a test class to test the methods length, charAt, substring, and indexOf in the java.lang.String class.
-
Consider the following project information. The total budget is $36,000 and is expected to last six months. After four months, you have calculated the following information about the project: PV =...
-
Go to www.nu-solutions.com/downloads/earned_ value_lite.pdf and access the article by Q. W. Fleming and J. M. Koppelman, Earned Value Lite: Earned Value for the Masses. From your reading, summarize...
-
Type in the address www.massdot.state.ma.us/highway/TheBigDig.aspx and navigate through the Web site supporting the Boston Tunnel project. Evaluate the performance of this project using the model of...
Study smarter with the SolutionInn App