Hw12 Java Programming Solved

25.00 $

Category:

Description

5/5 - (2 votes)

1. Write a JAVA method that expands a given binomial (ax + by)n, where integers a, b, n are user inputs. For example, if a = 2, b = -12, n = 4 are entered the method should print or return

(2x – 12y)^4 = 16x^4 – 384x^3y + 3456x^2y^2 – 13824xy^3 + 20736y^4

Use the Pascal’s triangle method using only one 1-dim array to calculate all binomial coefficients.

Your main program should use an appropriate loop for repeated inputs.

  • HW12-expand-binomials-bkcojt.zip