CIS 160 Methods exercise #1

Objective

  • Create Java methods to solve problems

Exercise

  • Write a method named square that takes a double as an argument, and returns a double which is the square of the argument passed in (the number times itself).
  • Write a method named area that accepts two integers (one representing the length of a rectangle, the other the width) and returns an integer which is the calculated area of the rectangle (length * width).