Methods :: Problem Set

  1. Write a method called circleArea whose value is to be the area of a circle whose radius is given as the parameter of the method.
  2. Write a method called interest whose value is the yearly interest to nearest cent on a bank balance. The amount of the balance and the yearly interest rate (as a percentage) are to be the parameters of the method
  3. Write a method called inflate that, given as parameters an amount of money and a constant annual rate of inflation, will produce a list of the inflated values of the original amount at the end of each year for ten years.
  4. Write a method called maxNum that would find the maximum number value between two integer numbers. Both numbers are passed to the method as parameters.
  5. Write an int method named "calendar" that takes one string parameter representing the name of any month of the year. The method should then return the number corresponding to that specific month. For instance, "march" or "mar" would return 3, and "july" would return 7.
  6. Write a method that takes 3 integer values and returns the smallest value.
For answers click here