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

  Indicate whether or not there is a carry

1 ) What is the base-10 equivalent of: 1111, a 4-bit one's complement number 4) Add the following 16-bit 2's complement numbers (represented in Hex): 78CF + FAB4 and indicate whether or not there is a carry and/or an overflow generated. Also, if n..

  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

  Arrests-convictions resulting from someone hacking in bank

Search online to discover and post the article which reports any particular examples of arrests/convictions resulting from someone hacking into the bank.

  What default behavior overloaded operator a copy constructor

What is the default behavior for the overloaded operator and the copy constructor functions

  Draw a complete e-r diagram

Each club has one moderator, who might or might not be a faculty member. Draw a complete E-R diagram for this example. Include all constraints.

  Normally this representation has a fixed size

Most programming languages have a built-in integer data type. Normally this representation has a fixed size, thus placing a limit on how large a value can be stored in an integer variable.

  The average degree for vertices distributed uniformly

Given the number of vertices n and the target expectation d of the average degree for vertices distributed uniformly on the surface of the unit radius sphere, determine a formula for the threshold r such that a random geometric graph on a spher..

  The wireless technology company

The Wireless Technology Company

  Explain what is file type-from where file types come

What is "file type?" Where do file types come from? Write down some of the information that file types give (tip: think about copying and pasting, also importing/exporting between files)?

  Some time on a new parallel computer

You are given some time on a new parallel computer. You run a program which parallelizes perfectly during certain phases, but which must run serially during others.

  Cell e2 that will calculate gross pay.

Part 1: Write a formula as if it were in Cell E2 that will calculate gross pay. Write the formula so that it may be copied to the other employees without modification.

  Pseudocode int an iterative one

Turn the following pseudocode int an iterative one, Assuming k is in T: if k is in T, Insert should change its associated item to x.

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