Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 9:01 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: Java Programming Problem: Pascal's Triangle
PostPosted: Mon Jul 20, 2009 3:05 am 
Offline
Newbie
User avatar

Joined: Mon Jul 20, 2009 2:58 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time

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();
}
}


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 video chat application in java
 navigating to database using java
 java mobile apps
 need help in java
 Read your gmail using Java code
 Java Programing to communicating port parallel
 Java Chat
 Steganography in java
 java code for listing folder contents from remote folder
 java

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 5 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team