Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Scott Dunning Newsgroups: comp.lang.java.programmer Subject: Re: Class assignment help Date: Mon, 21 Jul 2014 15:34:40 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 21 Jul 2014 22:32:15 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="11828741c91d0da908948c6ecdf164c7"; logging-data="26166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DCoP1wTBr8q5uXB0HPGaoZ5fI2LEV4YQ=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: Cancel-Lock: sha1:xpEdF5YiLD8VjH7Oj2L/kZJ5Fwk= Xref: csiph.com comp.lang.java.programmer:29172 On 7/21/14, 2:30 PM, Jeff Higgins wrote: > On 07/21/2014 05:29 PM, Scott Dunning wrote: >> On 7/21/14, 12:35 PM, Roedy Green wrote: >>> On Mon, 21 Jul 2014 10:50:22 -0400, Tim Slattery >>> wrote, quoted or indirectly quoted someone who said : >>> >>>> You'll need to assign them a dummy value (highName = "no >>>> name yet";) or an empty string (secondHighName = "";) to get rid of >>> >>> null will keep it happy. You might later get an NullPointerException >>> if you don't get a real value in there soon enough. >>> >> >> >> So I got it "working" which is to say it will run. However, after it >> asks to how many students names and grades I'd like to enter it asks >> both of the next questions at the same time and that then causes an >> error. Since it's in the for loop I'm not sure how to get it to ask the >> questions separately. Any tips? > > java.io.Console - if you're allowed to use it. > > I just stumbled onto something called hasNext, will something like that work you think, provided I can figure out how to use it?