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

  Design and develop a console application

Required to design and develop a console (text-based) application for a small car servicing company -

  Write java program to print price of table-furniture company

Write down the Java program for furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate the price of table produced with chosen wood.

  Three most primary forms of loops: the while loop, the do..

explored the world of loops we have accepted the three most primary forms of loops: the while loop, the do...while loop (even though Python does not use this loop), and the for loop. The for loop has approximately three primary implementations that w..

  Write a program that reads in a list of numbers from a file

write a program that reads in a list of numbers from a file and adds up all those numbers. You may hard code in the name of the file, allowing the user to input the filename is not required

  Program produces 1000 integer ranging

Then your program produces 1000 integer ranging from 1to 10000 in the array and then sort them in ascending order and then print the result into data.txt file. (You may list integers separated by space or new line)

  Write a server for multiple clients

Write a server for multiple clients. The client sends loan information (annual interest rate, number of years, and loan amount) to the server. The server computes monthly payment and total payment and sends them back to the client.

  Create listener objects for each jcombobox

Create listener objects for each JComboBox that set the background color of the panel when the user selects an integer. Use the current values supplied by the JComboBox objects to determine the background color.

  Product maintenance with a database

Use a class named ProductDB that's in the music.data package to add, update, and delete the products in the Product Maintenance application.

  Your task in this assignment is to develop a graphical user

your task in this assignment is to develop a graphical user interface based java program that can communicate with a

  Write a java program that uses the elapsed time

Write a Java program that uses the elapsed time for an event in second and then outputs the elapsed time in hours, minutes and seconds. (For example, if the desired time is 9630 seconds, then the output is 2: 40: 30)

  Point of sale terminal

a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sales terminals of the store. The users can use the system to manage sales items in the store, customer details and of c..

  Requirementspig is a folk jeopardy dice game with simple

requirementspig is a folk jeopardy dice game with simple rules two players race to reach 100 points. each turn a player

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