Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Instructions Write a Java console application that prompts the user to enter the radius of a circle, then prints its radius, diameter, circumference, and

Java

image text in transcribed

Instructions Write a Java console application that prompts the user to enter the radius of a circle, then prints its radius, diameter, circumference, and area. The Console Output Enter the radius of the circle: 1.2 The radius is 1.2 The diameter is 2.4 The circumference is 7.5398223686155035s The area is 4.523893421169302 Programmer Notes Download Assign3 class to your local disk and run in a command window java Assign3 Follow Activity 3.4 to create the class Assign3. Generate its testing main method. Write and document your program per class coding conventions Manually type the methods getDiameter0, getCircumference), and getArea). To calculate the circumference and area, use 3.14159 or the Java defined constant Math.PI Create an instance of Scanner. Call print) to prompt the user to enter the radius. Call input.nextDouble) to get the user input. Call circle.setRadius) to set the radius. . Add an instance variable double radius. Generate its get/set methods In main method, create a new instance of Assign3: Assign3 circle-new Assign3); Then call println) 4 times, each with the value of getRadius, getDiameter, getCircumference, getArea, respectively

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions