Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double radius;
- Wheel (double radius) {
- this.radius = radius;
- }
- double getCircumference () {
- return 2 * Math.PI * radius;
- }
- double getArea () {
- return radius * radius * Math.PI;
- }
- public static void main (String[] args) {
- System.out.println("Please provide a real.");
- Scanner s = new Scanner(System.in);
- double d = s.nextDouble();
- System.out.println(d);
- Wheel w = new Wheel(d);
- System.out.println(w.getCircumference());
- System.out.println(w.getArea());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement