Declares several circle objects

Assignment Help Basic Computer Science
Reference no: EM13926432

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

Reference no: EM13926432

Questions Cloud

Conduct a swot analysis on the case study companies : Assignment Checklist: Conduct a SWOT analysis on the case study companies' mission statements. Create a case study analysis focusing upon the company's mission statement
Determine which data from the database to archive : Determine which data from the database to archive; that is, for each table, specify whether data needs to be archived. If it does, specify which data, when it should be archived, and whether it should be archived with data from another table.
Capital budget recommendation : Guillermo Navalles, owner of Guillermo Furniture faces a decision that could make or break the success or failure of his business. Because of increased competition and costs, profits for the Mexican company have taken a hit.
Analyzing an argument -from samizdat to twitter : How effectively does Burton's use of language help establish his credibility as well as emotional and logical appeal? Be sure to consider his rhetorical situation. Who is his audience and what is his purpose?
Declares several circle objects : 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 valu..
Should nonmoral claims override the moral claims : Is this a moral or legal/economic issue? Could it be both? What are some of the most important value and prescriptive claims involved here? Should any of the relevant nonmoral claims override the moral claims? Why or why not?
Create a view named largeslip using the data : Create a view named LargeSlip using the data in the MarinaNum, SlipNum, RentalFee, BoatName, and OwnerNum columns in the MarinaSlip table for those slips with lengths of 40 feet. Display the data in the view.
Name of all customers that have a credit limit : List the names of all customers that have a credit limit less than $10,000.
What is green technology : You currently work for a small private consulting company. It has been very successful in the current economy but business has started to slow down. Your competitors have started implementing green technology. Your boss has asked you to research g..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What are some presentation-tools options available

What are some presentation-tools options available in the market place? Pick 3 and research them. What are the advantages and disadvantages

  Creating and configuring virtual machine settings

Assignment Preparation: Activities include completing the Microsoft® Official Academic Course (MOAC) Labs, completing the Microsoft® Official Academic Course (MOAC) Lab Challenges, independent student reading, and research.• Complete MOAC Lab 7, "Cre..

  Change arp entry in computer for mac address

Print your ARP cache table. Find a server on your local network. Change its ARP entry in your computer to point to your computer's MAC address. Print new ARP cache table. Now use the service and see what happens.

  Create a histogram and a dot plot of the data

Create a random set of data equal to 25 samples with the random number generator. For the X column, use the Normal distribution with a mean of 100 and standard deviation of 20. For the Y column, use the Poisson distribution with a mean of 25. F..

  Circuit diagram-truth table for half subtractor-full adder

Illustrate the circuit diagram of the following circuit and create truth table for half subtractor and full adder. Full subtractor and Half adder.

  The object''s shadow length and shadow

Simple geometry can compute the height of an object from the object's shadow length and shadow angle using the formula: tan(angleElevation) = treeHeight / shadowLength. Given the shadow length and angle of elevation, compute the tree height.

  Write an instruction sequence to swap the upper

Write an instruction sequence to swap the upper four bits and the lower four bits of accumulator A [swap bit 7 with bit 3, bit 6 with bit 2, and so on]

  What potential consequences would an organization face if

powerpoint 5 slides not including first and last 250 speaker notes more than 2 references1. what are the definitions

  Assume that you have the following context free grammar

What string came from this sequence of derivations? (It should be obvious whether this is a left derivation or a right derivation.)

  Determining accurate formula using undetermined coefficients

Determine a more accurate formula for f'(t) using method of undetermined coefficients. Let's say the formula is of the form f'(t)= Af(t + 2h) + Bf(t + h) - Bf(t - h) - Af(t - 2h).

  Enforcing mandatory access control environment

Users dont seem to understand that they need to handle certain documents with more care and control than others. Which of the following will improve this situation?

  How to make the mail secure

How to make the mail secure As introduced in the proposal instruction, a proposal should include the following parts (more details see: https://people.ok.ubc.ca/rlawrenc/teaching/writingProposal.html):

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