Mon Jul 20, 2009 3:05 am
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();
}
}
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
Powered by phpBB © phpBB Group.