Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.osn.de!diablo2.news.osn.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 26 Feb 2014 08:54:25 -0600 Date: Wed, 26 Feb 2014 14:54:20 +0000 From: lipska the kat Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: java code References: <1o6dnRRLlOIZI5TOnZ2dnUVZ7oednZ2d@bt.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 60 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-lMR+PYWnEODDBiCJ2GNYe/e/mFYUcpDqVUbABXV5b4D1eIahChCJJdpzccrIOnYhrT/6tTznOstOvUh!2aEBgk+rtbOjyOvhmINvuubI23n2RUpDlKilTb+GEZpU0O70GWzYrH6wv5WVts9wt9I1MqTS8xIM X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2854 Xref: csiph.com comp.lang.java.programmer:27596 On 25/02/14 22:54, Daniel Pitts wrote: > On 2/23/14 1:25 AM, lipska the kat wrote: >> On 21/02/14 00:03, jay'el antonio wrote: >>> please someone help me..what is the code of this output program using >>> java >>> 11 >>> 221 >>> 3321 >>> 44321 >>> 554321 >>> 6654321 >>> 77654321 >>> 887654321 > You are a Troll, sans Hunter. You also made that far more complicated > than it needs to be. > > public class BetterThanATroll { > public static void main(String[] args) { > String s = ""; > for (int i = 1; i <= 8; ++i) { > s = i + s; > System.out.println(i + s); > } > } > } Well now let's analyze your 'solution' shall we. Agreed the 'specification' is a little lacking but as we are unable to go back to the client at this time we need to make some assumptions. Assumption 1. It's 'homework' OK, now what do you imagine the learning objectives are? Well it certainly looks 'loopy' so Assumption 2. It's intended to get the student to learn about loop control variables, possibly to control nested loops. The output is numeric so Assumption 3. It's intended to exercise some understanding of manipulation of numeric variables ... Well that's about it for the assumptions, now how does your solution meet the objectives? ... ah yes, String concatenation in a for loop 1/10 for effort -- Lipska the KatŠ: Troll hunter, sandbox destroyer, treacherous feline and farscape dreamer of Aeryn Sun GNU/Linux user #560883 - http://www.linuxcounter.net