Java - Access Specifiers  Create a class named Circle that has attributes radius, area, and circumference and make the attributes private. Make a public method that sets the radius and a method that prints all attributes. Ask the user input for radius. Note: Use the PI from the math functions Inputs A line containing an integer 10 Sample Output Radius: 20   Area: 1256.64 Circumference: 125.66

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 3RQ: The Inventory class contains a Private variable named strId. The variable is associated with the...
icon
Related questions
Question

Java - Access Specifiers 

Create a class named Circle that has attributes radius, area, and circumference and make the attributes private. Make a public method that sets the radius and a method that prints all attributes. Ask the user input for radius.

Note: Use the PI from the math functions

Inputs

A line containing an integer

10

Sample Output

Radius: 20

 

Area: 1256.64

Circumference: 125.66

Test Cases
O Constraint 1
The code must have a class called Circle.
Test Cases
Executions
O Test Case 1
Expected Output
Radius: 20
Area: 1256.64
Circumference: 125.66
Transcribed Image Text:Test Cases O Constraint 1 The code must have a class called Circle. Test Cases Executions O Test Case 1 Expected Output Radius: 20 Area: 1256.64 Circumference: 125.66
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning