Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.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 16:06:24 -0600 From: rossum Newsgroups: comp.lang.java.programmer Subject: Re: java code Date: Wed, 26 Feb 2014 22:06:22 +0000 Message-ID: References: User-Agent: ForteAgent/7.20.32.1218 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 41 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-zrhYV+zsXrzjhDPkw7iFfOCPeHhG6SpYDTLjIxKDAMx+mi0zwxhBo21O8jjKiljiXO8X5EG9+puF9MC!euDbSKv3c535ksJlRhZo7iduRTK67IL2+BcbihOxe9zn7s/W8/VV5aZmeGpskGHaHvulJ6PrZVjg!3o/n 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: 2477 Xref: csiph.com comp.lang.java.programmer:27607 On Thu, 20 Feb 2014 16:03:51 -0800 (PST), "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 There are an extremely large number of possible programs. It is not difficult, with a little thought, to find one of those many programs for yourself. Here are some things to think about: 1) Each line after the first is one character longer than the previous line. What is the extra character that is added at the right hand end of the previous line to extend it? Can you write a method that takes a string and adds the required additional character to it? 2) Now look at the first part of each string (after the first line), before the additional character. How is it derived from the previous line? Can you write a method that takes a string and transforms it so it looks like the first part of the next line? 3) Now think about how to combine the two methods from 1) and 2) into a program to produce your desired output, given a starting string and how many lines you want to produce. 4) Code you program. 5) Test your program. You will almost certainly find errors. Fix the errors and retest. Repeat until your program is working correctly. 6) If you want me to write your program for you, my rates are $300 per hour. rossum