<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Exercise 5-1: Conditionals</title>
	<atom:link href="http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningprocessing.com</link>
	<description>A Beginner's Guide to Programming Images, Animation, and Interaction by Daniel Shiffman</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:27:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anonymous</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-20653</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 14 Nov 2011 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-20653</guid>
		<description>I would suggest doing something like when you click the mouse a new grade is picked.

void mousePressed() {
  grade = random(100);
}</description>
		<content:encoded><![CDATA[<p>I would suggest doing something like when you click the mouse a new grade is picked.</p>
<p>void mousePressed() {<br />
  grade = random(100);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andre</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-20652</link>
		<dc:creator>Andre</dc:creator>
		<pubDate>Mon, 14 Nov 2011 14:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-20652</guid>
		<description>// what if you wrote in this code so that the code is run dynamic instead of static
// You notice that the same results occurs 
// How to you fix this so that different println comments are shown instead of assign letter B all the time.

float grade = random(100);

void setup() {
  size(200, 200);
}

void draw() {
  
  //grade = random(100);

if (grade =71) {
  println(&quot; Assign letter B.&quot;);
}

else if (grade =61) {
  println(&quot;Assign letter C.&quot;);
}

else if (grade =51) {
  println(&quot;Assign letter D.&quot;);
}
  
  else {
    println(&quot;Failed.&quot;);
  }
  
}</description>
		<content:encoded><![CDATA[<p>// what if you wrote in this code so that the code is run dynamic instead of static<br />
// You notice that the same results occurs <br />
// How to you fix this so that different println comments are shown instead of assign letter B all the time.</p>
<p>float grade = random(100);</p>
<p>void setup() {<br />
  size(200, 200);<br />
}</p>
<p>void draw() {<br />
  <br />
  //grade = random(100);</p>
<p>if (grade =71) {<br />
  println(&#8221; Assign letter B.&#8221;);<br />
}</p>
<p>else if (grade =61) {<br />
  println(&#8220;Assign letter C.&#8221;);<br />
}</p>
<p>else if (grade =51) {<br />
  println(&#8220;Assign letter D.&#8221;);<br />
}<br />
  <br />
  else {<br />
    println(&#8220;Failed.&#8221;);<br />
  }<br />
  <br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabe</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-5670</link>
		<dc:creator>Gabe</dc:creator>
		<pubDate>Mon, 19 Oct 2009 02:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-5670</guid>
		<description>that is why you&#039;re the teacher...*bows</description>
		<content:encoded><![CDATA[<p>that is why you&#8217;re the teacher&#8230;*bows</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-5668</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 19 Oct 2009 01:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-5668</guid>
		<description>You have to use a logical &quot;AND&quot; represented by &#039;&amp;&amp;&#039;, i.e.

&lt;pre&gt;
if (grade &gt;= 70 &amp;&amp; grade &lt; 80) {
  println(&quot;Grade is greater than or equal to 70 and less than 80.&quot;);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You have to use a logical &#8220;AND&#8221; represented by &#8216;&#038;&#038;&#8217;, i.e.</p>
<pre>
if (grade >= 70 &#038;&#038; grade < 80) {
  println("Grade is greater than or equal to 70 and less than 80.");
}
</pre>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabe</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-5665</link>
		<dc:creator>Gabe</dc:creator>
		<pubDate>Sun, 18 Oct 2009 22:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-5665</guid>
		<description>Is there another way of defining ranges of numbers in the conditionals block?

else if(grade = 70-79){
printIn(&quot;You just earned a C, genius&quot;);
}

I return an error in this way. I know that I should use &lt;=79. Is it that Processing is reading &quot;70-79&quot; as 70 minus 79 versus 70 through 79? I tried a comma, like in the random() function, but failed. Just wondering.</description>
		<content:encoded><![CDATA[<p>Is there another way of defining ranges of numbers in the conditionals block?</p>
<p>else if(grade = 70-79){<br />
printIn(&#8220;You just earned a C, genius&#8221;);<br />
}</p>
<p>I return an error in this way. I know that I should use &lt;=79. Is it that Processing is reading &quot;70-79&quot; as 70 minus 79 versus 70 through 79? I tried a comma, like in the random() function, but failed. Just wondering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-5521</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 15 Oct 2009 02:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-5521</guid>
		<description>Yes, technically speaking this would be more precise, in terms of grading!</description>
		<content:encoded><![CDATA[<p>Yes, technically speaking this would be more precise, in terms of grading!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zaira</title>
		<link>http://www.learningprocessing.com/exercises/chapter-5/exercise-5-1/comment-page-1/#comment-5488</link>
		<dc:creator>Zaira</dc:creator>
		<pubDate>Wed, 14 Oct 2009 01:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1373#comment-5488</guid>
		<description>Shouldn&#039;t we write it as
if (grade&gt;=90){
println(&quot;Assign Letter grade A.&quot;);
}else if (grade&gt;=80){
println(&quot;Assign letter grade B.&quot;);

and so forth. 
or does the code already set that limit so in which the second conditional &quot;If grade is greater than 80 assign grade B&quot; will only go from 80-89. I feel like since 91 is greater than 80 it will still assign a B letter grade.</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t we write it as<br />
if (grade&gt;=90){<br />
println(&#8220;Assign Letter grade A.&#8221;);<br />
}else if (grade&gt;=80){<br />
println(&#8220;Assign letter grade B.&#8221;);</p>
<p>and so forth.<br />
or does the code already set that limit so in which the second conditional &#8220;If grade is greater than 80 assign grade B&#8221; will only go from 80-89. I feel like since 91 is greater than 80 it will still assign a B letter grade.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

