1. Engineering
  2. Computer Science
  3. please use java programming language important use this main method...

Question: please use java programming language important use this main method...

Question details

Problem 5: Pascals Triangle (25 points) Develop an algorithm that returns a String pattern of Pascals Triangle of size N. For more information on Pascals Triangles, look here Example output for N 9 1 1___2 1 1 3 31 1 4 6 41 1 5 10 10 51 1 6 15 20 15 6 1 7 21 35 35 21 7 1 1 82856 70 56 28 Note: there are three spaces between each number in a given line. Ive included the underscores here to highlight that. The underscores to the left of the 1s denote spaces thats necessary to make the numbers look like a triangle

please use java programming language.

*Important: use this main method in your code

This function imp Lements Pascal tabte printing * https://en,wikipedia.org/wiki/Pascal&27s triangle * eauthor harsh public class PascatTriangle implements XPattaro. E /tok * Print the pascal triangle for n 10 1 5 10 105 1 1 615 2015 61 17 21 35 35 217 1 1 8 28 56 70 56 2881 @Override public String printPattern int n) f /1 TODO Auto-generated method stub return null; /4 Print the 10th line of pascal triangle 1,8,28,56,7,56,28,8,1 @Override public String printNthItem(int n) f / TODO Auto-generated method stub return null; public static void main(String] args) IPattero. obj -new PascalTriangle): Syste.ut Rrint.in(Generating individual lines:): for(int 1-1; 1<10; i++) Syssem.out.Rrintin(obj.printNthItem(i)): Sys.tem.eut Rrintla(Formatting into a pattern:); SYA5FB.QHE.RrADt La(obj.printpattern(10): eoverride public void setParam(int arg) f // Leave this blank

*

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution