<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Scanner class = scn.next()' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Scanner class = scn.next()' posted on the 'Java' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2010 Programmers Heaven</copyright>
    <pubDate>Thu, 18 Mar 2010 10:14:11 -0700</pubDate>
    <lastBuildDate>Thu, 18 Mar 2010 10:14:11 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Scanner class = scn.next()</title>
      <link>http://www.programmersheaven.com/mb/java/408993/408993/scanner-class--scnnext/</link>
      <description>Hi there, &lt;br /&gt;
I am supposed to do a randomization of questions and the user answer them. &lt;br /&gt;
&lt;br /&gt;
An example would be what does IE stands for:&lt;br /&gt;
the user must enters Internet Explorer. and it's correct. &lt;br /&gt;
&lt;br /&gt;
However, in my programme, whenever the user enters "Internet Explorer" or any other string that has space, my program could not detect the correct answer. and it will loop 2 times depending on the String after the space the user entered. Example, Internet Explorer will loop 2 questions out. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is my source codes:&lt;br /&gt;
 &lt;pre class="sourcecode"&gt;System.out.print("Ans: ");
     answer = scn.next();
  for (int num = 0; num &amp;lt; array.length; num++)
  {
  if (answer.toLowerCase().equals(array[num])
  {	
       accPoints += 20;
   System.out.println("Correct! You have " + accPoints + " points now!");
                     
 }
else 
 {
correct = false;
if (num ==0)
System.out.println("Incorrect! The answer is [" + array[num])+ "]");
}
}
              
&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java/408993/408993/scanner-class--scnnext/</guid>
      <pubDate>Mon, 09 Nov 2009 20:22:24 -0700</pubDate>
      <category>Java</category>
    </item>
  </channel>
</rss>