Hi,
I've been at this question all day and still just don't know what to do. It's the last of all the questions I have to do and can't figure it out!!
If anyone could help or give guidance it would be greatly appreciated!!
Question:
Write a class called shapes that accepts two variables into its constructor called a and b. Along with the getter and setter methods required, write a method called toPrinter() to output the coordinates of the shape in the following format: [a, b].
Next write a class called orange that is a child class of shapes. This time the constructor accepts in a, b (centre of the orange), and a radius. Override the toPrinter() method in the orange class to include outputting the radius, as well as a and b. Write a method to get the area of the orange. Include any relevant classes to run and test the application.
Many Thanks
I've been at this question all day and still just don't know what to do. It's the last of all the questions I have to do and can't figure it out!!
If anyone could help or give guidance it would be greatly appreciated!!
Question:
Write a class called shapes that accepts two variables into its constructor called a and b. Along with the getter and setter methods required, write a method called toPrinter() to output the coordinates of the shape in the following format: [a, b].
Next write a class called orange that is a child class of shapes. This time the constructor accepts in a, b (centre of the orange), and a radius. Override the toPrinter() method in the orange class to include outputting the radius, as well as a and b. Write a method to get the area of the orange. Include any relevant classes to run and test the application.
Many Thanks
Comment