The area of a circle is pi multiplied by the square

Assignment Help Basic Computer Science
Reference no: EM13658660

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: EM13658660

Questions Cloud

Calculate the time-weighted geometric average return : Calculate the time-weighted geometric average return on this portfolio and calculate the time-weighted arithmetic average return on this portfolio and calculate the dollar-weighted average return on this portfolio
Discuss how an indexed bond portfolio is constructed : Describe advantages and disadvantages of bond indexing relative to active bond management - Webb Street manages indexed bond portfolios. Discuss how an indexed bond portfolio is constructed under stratified sampling (cellular) methods.
What is the duration if the yield to maturity : Find the duration of a 6% coupon bond making annual coupon payments if it has maturity and has a yield to maturity of 6%. What is the duration if the yield to maturity is 10%. Find the duration of the bond if the coupons are paid semiannually.
Astronaut in his space suit and with propulsion unit : An astronaut in his space suit and with propulsion unit (empty of its gas propellant) strapped to his back has a mass of 140kg.Through a space walk, the unit, which has been totally filled with propellant gas, ejects some gas with a velocity of +32m/..
The area of a circle is pi multiplied by the square : The area of a circle is pi multiplied by the square of the radius
What are two main functions of user accounts in a network : 1. What are the two main functions of user accounts in a network? As a network administrator, how would you establish user rights and permissions to minimize maintenance efforts? How would you assign work groups? what are some issues with user..
Net torque on the stone regarding the center of the circle : A 2.00 kilogram stone is tied to a 0.500-m length of string and swung around a circle at a constant angular velocity of 12.0 rad/s. What is the net torque on the stone regarding the center of the circle?
Discover the speed of the particle before impact : The figure below shows a thin, uniform bar of length D =1.11 m and mass M =0.82 kg pivoted at the top. The rod, which is originally at rest, is struck by a particle whose mass is m = 0.30 kg at a point x = 0.80d below the pivot.
Distant objects in focus when wearing glasses by refractive : A nearsighted patient's far point is 0.645 m from her eyes. She is able to see distant objects in focus when wearing glasses by a refractive power of -1.6 diopters. What is the distance among her eyes and the glasses?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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