Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!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: Mon, 17 Jun 2013 03:36:19 -0500 Date: Mon, 17 Jun 2013 09:36:17 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> 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: About java program. References: <324f929f-772e-4004-81e1-6b454cdae794@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 44 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-LyUY4L1jb1uMgMG0yFDbqtPQSYWTMR5u3u+pY1P8WPlnchHAC3GIZSP9SQajSzLo+mpx5mzGUOOItKQ!H80fuV7ZroIaIJnAZFvdKaZmpf78oAhWH7ThKpJCEc7Z48du8jiCIFeRHtL3QCg7qyixsvoawio= 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: 2640 Xref: csiph.com comp.lang.java.programmer:24433 On 16/06/13 16:28, Robert Klemme wrote: > On 16.06.2013 15:21, lipska the kat wrote: >> On 16/06/13 00:12, Robert Klemme wrote: >>> On 15.06.2013 22:38, rajbhaumik@gmail.com wrote: >>>> import acm.program.*; >>>> public class askYesNoQuestion extends ConsoleProgram { >>>> public void run(){ >>>> String str=readLine("Would you like instructions"); >>>> println(askYesNoquestion(str)); >>>> } >>>> 7. private boolean askYesNoquestion (String str){ >>>> if(str.equals("yes"))return true; >>>> if(str.equals("no")) return false; >>>> } >>>> >>>> } >>>> the false is that , the program cannot be executed, because no 7 >>>> said, this method must return a type of boolean. >>> >> >> One possible solution (not compiled or tested) >> >> private boolean askYesNoquestion (String str){ >> boolean response = false; >> if(str.equals("yes")){ >> response = true; >> } >> return response; >> } > > Why are you making it so complicated? Just do Complicated? What's complicated about it. I thought it was eminently understandable. Do you need me to explain it to you? ;-) lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun