Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercice 2: Complete the definition of the following classes so the class TestCase could work correctly class point {/} class Circle extends Point {} class
Exercice 2: Complete the definition of the following classes so the class TestCase could work correctly class point {/} class Circle extends Point {} class Cylinder extends Circle {} class TestCase \{ public static void main (String [] args) {/ a point is defined by two coordinates x and y/ Point p= new Point (2.0,2.0); System.out.println(" Point > " +p); /* a circle is defined by the coordinates x and y and a radius / Circle c= new Circle (2.0,2.0,3.0); System.out.println( "Circle >"+c+ " surface : +" + c.surface ()); /* a cylinder is defined by two coordinates x and y representing its center, a radius and a height / Cylindre cc= new Cylindre (2.0,2.0,3.0,10.0); System.out.println("Cylindre > " +cc+ ", surface : + " + cc.surface ()); \}\} N.B. : The cylinder surface is : 2 surface of a circle +23.14 radius * height
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started