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

  Create a japplet

Create a JApplet that contains a JLabel and JButton. You'll create a JButton that will automatically change font typeface, style, and size when clicked by the user.

  In this project you need to write a program called

in this project you need to write a program called ecc.javato implement elliptic curve

  Write an application that uses an array

Write an application that uses an Array to store 10 messages of type String. You will store this Array with 10 messages of your choosing.

  Implement a third component of the compiler

To detect duplicate declarations using the same identifier, you call the method retrieveOneLevel. This method returns a pointer to the identifier entry if the identifier was declared before in the current scope and null otherwise.

  You will need a bottomuptwothreefourtree class with a

you will need a bottomuptwothreefourtree class with a bottomuptwothreetreefourtree constructor which takes no

  Write a program called gf2java to implement the finite

write a program called gf2.java to implement the finite field gfpn where p is a prime number and n is a positive

  1 securityimplement security so that all users can view the

1. security.implement security so that all users can view the information about the projects but only authenticated

  Aimthe problem and implementing the design using principles

aimthe problem and implementing the design using principles of correct syntax program structure and

  What is the paintcomponent method how is it used in java

q1. what is the paintcomponent method? how is it used in java graphics? how does a program intentionally cause the

  What is the purpose of the restrict keyword in c99

Arrays of strings in C and C++ can also be initialized with string literals. In this case, the array is one of pointers to characters.

  Class to initialize values

Create a constructor that allows a user of the class to initialize values. Also create a method named SetJustSold()(Hint ++) that increments the number of hot dogs the stand has sold by one and should also increase the TotalSold by one

  Write a java program that prompts the user

Write a Java program that prompts the user to input three numbers.  This program should then output the numbers in an ascending order.

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