Thursday 23 January 2014

Programming Methods

Create a java project to calculate the area, diameter and circumference of the circle. The project will have a class named "Circle" with 4 variables for radius, area, circumference and diameter. The class will have a constructor that accepts radius as a float type argument and initializes the radius variable of the class. Create 3 methods calcArea(), calcDiameter() and calcCircumference() that will calculate the area, diameter and circumference respectively of the circle and display the output on the console. Create another class called "CircleDemo" that has the main(). The main method will declare 2 circle objects and will get the radius value from the user and pass it to the constructor of the circle class.
Click here for more on this paper.......

No comments:

Post a Comment