Esempio n. 1
1
  public static void main(String args[]) {
    Math m = new Math();

    System.out.println("5 + 9 = " + m.add(5, 9));

    System.out.println("8 - 2 = " + m.sub(8, 2));

    System.out.println("4 x 7 = " + m.multiply(4, 7));
  }
Esempio n. 2
0
  public void testMulitply() {

    int num1 = 3;
    int num2 = 7;
    int total = 14;
    int sum = 0;
    sum = Math.multiply(num1, num2);
    assertEquals("Problem with multiply", sum, total);

    num1 = 5;
    num2 = 4;
    total = 20;
    sum = Math.multiply(num1, num2);
    assertEquals("Problem with multiply", sum, total);
  }