[nbusers] Need help"write a program to print triangular with * "

  • From: "Soonwh" < >
  • To:
  • Subject: [nbusers] Need help"write a program to print triangular with * "
  • Date: Tue, 27 Nov 2012 05:45:31 -0500

TQ,
i has try alot ways before i post this tread.
can teach me? 



ionuion wrote:
> Soonwh,
> 
> this is clearly homework. The best thing I can do is give you some 
> references.
> You can find out how you can work with command line arguments:
> http://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html
>  
> (http://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html)
> Even translating a command line argument (which is necessarily a String) to 
> a integer, which you need is documented on that page:
> 
> > firstArg = Integer.parseInt(args[0]);Regards
> 
> On Tue, Nov 27, 2012 at 5:10 AM, Soonwh <address-removed (address-removed)> 
> wrote:
> 
> >  I need help to write a program that takes a command-line argument N and 
> > print and N-by-N triangular pattern as below:-
> > 
> > ******
> > .*****
> > ..****
> > ...***
> > ....**
> > .....*
> > 
> > 
> > i done half of it, but other part i cant get it.
> > 
> > package ass1;
> > 
> > public class Ass1 {
> > 
> > Â  Â public static void main(String[] args)
> > 
> > Â  Â {
> > Â  Â  Â  Â int x, y ;
> > Â  Â  Â  Â for(x=1; x<=6; x++)
> > 
> > Â  Â  Â  Â {
> > Â  Â  Â  Â  Â  Â for ( y=1; y<x; y++)
> > 
> > 
> > Â  Â  Â  Â {
> > Â  Â  Â  Â  Â  Â System.out.print("*");
> > Â  Â  Â  Â }
> > 
> > Â  Â  Â  Â {
> > Â  Â  Â  Â System.out.println();
> > Â  Â  Â  Â }
> > 
> > Â  Â  Â  Â }
> > Â  Â }
> > 
> > 
> > 
> > 
> > 
> 







[nbusers] Need help"write a program to print triangular with * "

Soonwh 11/27/2012

[nbusers] Re: Need help"write a program to print triangular with * "

Ion Iovu 11/27/2012

[nbusers] Need help"write a program to print triangular with * "

Soonwh 11/27/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close