Answer to Question #254862 in Java | JSP | JSF for pvv

Question #254862
Class named RectanglePerimeter with the following methods: +perimeterCalculator(double length,double breadth) : double - Should take two numbers and return a number as result - The logic for finding perimeter should be implemented in this method Use Main method class and display the output using object of RectanglePerimeter
1
Expert's answer
2021-10-22T00:50:25-0400
public class RectanglePerimeter {
    public double perimeterCalculator(double length, double breadth) {
        return 2 * (length + breadth);
    }
}


public class Main {
    public static void main(String[] args) {
        RectanglePerimeter perimeter = new RectanglePerimeter();
        System.out.println(perimeter.perimeterCalculator(10.5, 1.2));
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS