Total members 11890 |It is currently Fri Apr 19, 2024 9:32 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Your job for this assignment: write a two class application that accepts a positive integer input (n) from the user, and then prints rows 0 through n to the console. The pattern above (ignoring the fancy blocking) should be the result when you input 6.

Your classes should be: PascalDriver, where main() resides; and PascalTri, where the real computational work is done. We have given PascalDriver to you. Finally, the code you submit for this assignment should be documented: every instance variable should have a comment that briefly describes its role, and before every method you should write a comment that describes what the method does.

Note:

1) This is a two class assignment. We've identified the classnames for you and given you the body of the driver class. Look carefully at the syntactic elements, such as braces, we've used to wrap the input box. You should paste the entirety of the PascalTri class in the box. Be sure that you don't paste the lines defining the class (E.g., public class PascalTri{...)

2) Unlike other OWL assignments, you only get three submission tries. Be sure to get the program running first before you submit.

import java.util.Scanner;

public class PascalDriver{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of rows");
int rowCount = scan.nextInt();
PascalTri t = new PascalTri(rowCount);
t.displayRows();
}
}




Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Java Programming Problem: Pascal's Triangle
 pascal triangle     -  
 convert pascal code to c ?     -  
 i want some help in java programming     -  
 Java Programming help please?     -  
 Programming a Defragger in Java     -  
 Programming Calendar Java     -  
 Triangle of stars (C++)     -  
 java tree problem     -  
 Draw Triangle using Lines     -  
 Drawing a triangle with colors     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com