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

  Explain why companies get better results-information system

Using three components of information systems and complementary assets concepts, explain why some companies achieve better results with information systems than others.

  Evaluate the natural settings of the test environment

Assess the reliability of data gathered via paid Internet users. Describe and assess the evaluation method being used by the testing company, i.e., nonvisual and verbal recording of browser activities and tester's vocal comments.

  Client health-care facilities-information-gathering process

shoulde patients in client health-care facilities participate in the information-gathering process? if so,why , and in what ways should they participate?

  Explain use of compensatory substituent in identification

Explain the use of "compensatory substituent" in identification and annotation of non-coding genes? Write down the difference between matrix and a Blosum60 Blosum20 matrix?

  Recognize ten different areas where software helps

In spreadsheet, recognize at least 10 different areas where software could help you, like collecting rent, performing tenant background checks, and scheduling building maintenance.

  Executing edi for competitive advantage

If firm chooses to execute EDI for competitive advantage, how can it assure advantage will last?

  Complete the one-variable data table

As a student at USI and a member of the budget committee for theMadrigal Feaste, you have been given a partially completed workbook, MadrigalFeaste.xlsx, and asked to complete the project.

  Draw the von neumann cycle and explain the basic function

Draw the Von Neumann Cycle and explain the basic function carried out in each state.

  Focus on the function and how it is secured by the use

Explain two or three uses for Microsoft Certificate Services. Focus on the function and how it is secured by the use of a PKI.

  Eliminate the transitive dependency in this relation

Vendor is functionally dependent on Compname and Compname is functionally dependent on Prodname. Eliminate the transitive dependency in this relation and form 3NF (third normal form) relations.

  Write a java statement to display the string

Write a Java statement to display the string "The value is 100" to a user in a plain dialog box.

  Which machine has better performance

Which machine has better performance? By how much? Justify your answers. Instruction Class Cycles needed Instruction Frequency

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