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

  How do c++ chars differ from java chars

How do C++ chars differ from Java chars?

  Write an essay on turing machine explain with examples

Write an essay on turing machine explain with examples

  Calculating loan payments using the pmt function

In this project, you will complete a vehicle-shopping workbook to compare the purchase of several vehicles. Calculating Loan Payments Using the PMT Function

  The use of borrowed material and utilize original ideas

The paper should be in the range of 1200 - 1500 words with double spacing. It is very important to include proper APA citation (in-text citations with quotation marks and source information, plus a reference list). Please minimize the use of bo..

  Explain the difference between an object reference in java

Explain the difference between an object reference in Java and an object. Use an example to illustrate your answer.

  Write a simple computer program

Write a simple computer program that ask the user for coordinate value in certain form, and then reports the number in all three forms. This will be repeated for input coordinates of all three forms.

  The sunbeam owners spares club

Sunbeam was a marque of advanced cars built by various companies from 1901 to 1981. Initially a manufacturing company making their own cars, they eventually remodelled other production cars until they became a marque of the Rootes company until..

  Distance between nodes u and v

The distance between nodes u and v in graph is the length of the shortest path from u to v. Given a d-dimensional hypercube and a designated source node s, how many nodes are distance i from s, where 0

  Consider the following code fragment

Consider the following code fragment: for (int i = 0; i = 0; j--) { System.out.println(i + " " + j); } } How would i revise this fragment to output this: 0 0 1 1 1 0 2 2 2 1 2 0 3 3 3 2 3 1 3 0

  Showing how to use the html element

Describe the attributes that you think would be useful with the HTML element. Provide an example code snippet showing how to use the HTML element. !DocType Html

  What is the intent of regulatory compliance

What is the intent of regulatory compliance, and what is the role of IT in maintaining corporate compliance and what can happen to organizations and their senior management if they ignore compliance mandates?

  The computation result of the alu is negative

Suppose the MIPS ALU, in addition to a zero flag output, also has an additional flag output for "negative"which equals 1 whenever the computation result of the ALU is negative (i.e., has high-order bit set to1. Show how to modify the data path ..

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