Monday, October 6, 2008

Static method practice in class

  1. Make a static method that takes in two numbers and multiples them and returns the result. Call it multiplier(int x, int y)!
  2. Make a static method that takes in two integers and returns the lower of the two
    call it findMinimum()
    print out the results!
  3. Make a static method, call it dividerOfTwoNumbers(int x, int y){ }
    Ask the user for two numbers. Divide the first number by the second number IF the second number is not zero.
    If they enter a zero, tell them: "You fool! You can't divide by zero!"

No comments: