/CS113-Proj-5-Pascal-s-Triangle

Pascal's Triangle Implement a program to recursively print out Pascal's Triangle: 1: 1 2: 1 1 3: 1 2 1 4: 1 3 3 1 5: 1 4 6 4 1 6: 1 5 10 10 5 1 7: 1 6 15 20 15 6 1 8: 1 7 21 35 35 21 7 1 9: 1 8 28 56 70 56 28 8 1 10: 1 9 36 84 126 126 84 36 9 1 Important questions to ask yourself: What is the base case? What is the recursive case? What should the method return? Your class should be called Pascal and have one static method called triangle that takes an argument 'n' and returns the n-th line of Pascal's Triangle. Here is the code downloadfor the main method that will call the method you write. Only submit Pascal.java, do not submit Main.java.

Primary LanguageJava

Stargazers

No one’s star this repository yet.