Declares several circle objects

Assignment Help Basic Computer Science
Reference no: EM13659415

Create a class named Circle with field names radius, diameter, and area. Include a constructor that sets the radius to 1 and calculates the other two values. Include methods named setRadius() and getRadius(). The setRadius() method not only sets the radius, but calculates the other two values (as you know, the diameter of a circle is twice the radius, the area of a circle is pi multiplied by the square of the radius). Save class as Circle.java.

Create a class named TestCircle whose main method() declares several Circle objects. Using setRadius() method, assign one circle a small radius value (code a user input making use of Scanner of JOptionPane), and assign another a larger radius value (to be an input by a user as well). Do not assign a value to the radius of the third circle; instead retain the value assigned at object construction. Display all the values for three Circle objects. Save the class as TestCircle.java.

Note: Create an UML class diagram prior to coding the application.

Compile, run, and check the results. Submit the following:

1.The source file (If more than one file has been created, zip them into one .zip file for posting.)

2.An MS .doc file with explanations/comments of your solution and the results of a test run, including a screen shot picture

3.The UML class diagram of the application should be included in the deliverable as a part of the MS .doc above, or as a separate file

We are using jGrasp.

Reference no: EM13659415

Questions Cloud

How much work was done by the ball : A 0.150 kilogram ball that is thrown at a velocity of 30.0 m\s hits a wall and bounces back in the opposite direction by a speed of25.0m\s. How much work was done by the ball?
Complete a swot analysis for the selected industry : Complete a SWOT analysis for the selected industry. The SWOT analysis allows a business to understand how a competitor is positioned in the environment by assessing its strengths, weaknesses, opportunities, and threats.
How much kinetic energy is lost in the system : A dartboard with a mass of 2.2kg is suspended from the ceiling such that it is originally at rest. A 0.030kg dart is thrown at the dartboard with a velocity of 1.2m\s. After the dart hits the dartboard, the dart and the board initially move by a velo..
Discover the energy delivered to the circuit : A 8.00 Ω resistor, 10.0 mH inductor, and a 130 µF capacitor are connected in series to a 40.0 V (rms) source having variable frequency. Discover the energy delivered to the circuit through one period if the operating frequency is double the resonance..
Declares several circle objects : Declares several Circle objects
Support cable runs from the top of the boom to the tractor : A wrecking ball (weight = 4400 N)is supported by a boom, which might be assumed to be uniform and has a weight of 3000 N. As the drawing shows, a support cable runs from the top of the boom to the tractor.
What is magnitude of the earths magnetic field at that point : A 500 turn coil 15.0cm in diameter is originally aligned so that its axis is parallel to the Earth's magnetic fields. In 2.77ms, the coil is flipped so that its axis is perpendicular to the Earth's magnetic field. If an average voltage of 0.166V is t..
Two main functions of user accounts in a network : What are the two main functions of user accounts in a network?
Percentage of unique sample does searched volume represent : You are provided with a 1 cm3 of biological sample from which 0.1 mm thin sections are cut. A search for virus cells at a magnification of 100,000 has been proposed. The fluorescent screen on which the image is to be projected has a diameter of 15 cm..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Sort the array in the descending order using pointers

Create functions for the following tasks and make sure to pass a pointer to the table (array) as an argument to each of them.

  Write java code for your hello/loop

Write java code for your hello/loop

  Increasing the number of cpus in a computer system tends to

increasing the number of cpus in a computer system tends to increase system performance. there are different types of

  Do you think decision statements can be replaced with loop

Do you think decision statements can be replaced with loops? If so, please provide example.

  Convert from decimal to octal and hexadecimal

Convert from decimal to octal and hexadecimal a. 16.4 b. 39 c. 48.67

  Context-free languages is closed under the regular opeations

Show that the class of context-free languages is closed under the regular opeations, union, concatenation, and star.

  Write a sample program that asks for the center

Write a sample program that asks for the center and side length, then prints out the square (using the toString method that you inherit from Rectangle) and the area of the square.

  What will occur to supply-demand in short-term and long-term

Price of product in short-term and long-term also describe why you think supply, demand, or equilibrium price will be different, if at all, in short-term and long-term.

  What is the const keyword in c++ and why would you use

What is the const keyword in C++? Why would you use the const keyword

  Describe the structure of the world wide web

Describe the structure of the World Wide Web as interconnected hypertext documents and create and validate HTML documents - create presentations using Cascading Style Sheets and DHTML.

  What value is read into the variables by the following code

What value is read into the variables by the following code?

  Can a quantum computing bit-s multiple states contribute

Can a quantum computing bit's (qbit's) multiple states contribute any more computing power or hold any more extraordinary mathematical control/significance.

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