Write an application calccircumference

Assignment Help JAVA Programming
Reference no: EM13694961

Question: Write an application (CalcCircumference) that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference and area using the floating-point value 3.14159 for ?.

[Note: You may also use the predefined constant Math.PI for the value of ?.

This constant is more precise than the value 3.14159. Class Math is defined in package java.lang. Classes in that package are imported automatically, so you do not need to import class Math to use it.]

Use the following formulas (r is the radius):

diameter = 2r
circumference = 2?r
area = ?r2

Do not store the results of each calculation in a variable. Rather, specify each calculation as the value that will be output in a System.out.printf statement.

[Note: that the values produced by the circumference and area calculations are floating-point numbers. Such values can be output with the format specifier %f in a System.out.printf statement.]

Hints:

- For this exercise, output all floating-point values using the %f format specifier.

- System.out.printf( "Area is %f\n", ( Math.PI * radius * radius ) );

Sample Output:

Enter radius: 3

Diameter is 6

Area is 28.274334

Circumference is 18.849556

I cannot seem to get this to work for some reason could somebody provide me a code to compare and test? This one is complex and I don't know how to do it

Reference no: EM13694961

Questions Cloud

Write the equation to represent the reactions : Problem- What is given: 250.0 mL of 0.15 M HCHO2 with 100.0 mL of 0.20 M LiCHO2.The Ka for HCHO2 is 1.8 x 10 ^-4 . Write the equation to represent the reactions of the above buffer solution with
A large volume of ethanol containing some sulfuric acid : Problem- what would happen if the ester we made (isopentyl acetate) were to be heated with a large volume of ethanol containing some sulfuric acid
Write an application bmicalc : Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.
What would happen if you heated ester with naoh solution : Problem- What would happen if you heated (Isopentyl acetate) ester with NaOH solution. what would you expect to observe
Write an application calccircumference : Write an application (CalcCircumference) that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference and area using the floating-point value 3.14159 for ?.
What is the concentration at the same downwind distance : Assuming that the answer to part (a) above is exactly 50.0 ?g/m3, what is the concentration at the same downwind distance but at a cross-wind distance of 500 m off the centerline? Give your answer in g/m3.
What is the solubility of calcite : Problem- What is the solubility of calcite, CaCO3, in grams per milliliter of solution at a temperature where Ksp = 9.9 x 10^-9
Is the dissolution of srso4 exothermic or endothermic : Problem- Ksp for SrSO4 increases from 2.8 x 10^-7 at 37 degrees celsius to 3.8 x 10^-3 at 77 degrees Celsius. Is the dissolution of SrSO4 exothermic or endothermic
What is the concentration of ammonia in a solution : Problem- What is the concentration of ammonia in a solution if 22.23 ml of 0.1145 M HCl is needed to titrate to the equivalence point of a 100.00 ml sample of the solution

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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