Rectangle

Rectangle - double result; result = length * width; return...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Rectangle { double length = 5.0; double width = 2.0; public void setLength(double val) { length = val; } public double area ( ) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double result; result = length * width; return result; } public double perimeter () { return (length+width)*2.0; } }...
View Full Document

This note was uploaded on 11/30/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Ask a homework question - tutors are online