<?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: Would I write the addition and subtraction in the same algorithm or use branching?</title>
	<atom:link href="http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2</link>
	<description>Let us help you add it up!</description>
	<pubDate>Tue, 22 May 2012 17:15:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark aka jack573</title>
		<link>http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2/comment-page-1#comment-6867</link>
		<dc:creator>Mark aka jack573</dc:creator>
		<pubDate>Sun, 25 Oct 2009 08:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2#comment-6867</guid>
		<description>What I would do after getting the input from the user as to what operator they want to use, and checking that the input is valid, is:

- do a loop of 10 for each of the 10 questions.
- - get the 2 random numbers.
- - then do a switch on the inputted operator.
- - - according to which operator, generate the answer.
- - - ask the user to answer.
- - - compare the users answer to the generated answer.
- - - update the amount of correct answers if it is correct.
- - end switch.
- end loop.

OR

- do a loop of 10 for each of the 10 questions.
- - get the 2 random numbers.
- - then do a switch on the inputted operator.
- - - according to which operator, generate the answer.
- - end switch.
- - ask the user to answer.
- - compare the users answer to the generated answer.
- - update the amount of correct answers if it is correct.
- end loop.

Then check the amount of correct answers to output the message of congratualtions or not.

Good luck with it.&lt;br&gt;&lt;b&gt;References : &lt;/b&gt;&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>What I would do after getting the input from the user as to what operator they want to use, and checking that the input is valid, is:</p>
<p>- do a loop of 10 for each of the 10 questions.<br />
- - get the 2 random numbers.<br />
- - then do a switch on the inputted operator.<br />
- - - according to which operator, generate the answer.<br />
- - - ask the user to answer.<br />
- - - compare the users answer to the generated answer.<br />
- - - update the amount of correct answers if it is correct.<br />
- - end switch.<br />
- end loop.</p>
<p>OR</p>
<p>- do a loop of 10 for each of the 10 questions.<br />
- - get the 2 random numbers.<br />
- - then do a switch on the inputted operator.<br />
- - - according to which operator, generate the answer.<br />
- - end switch.<br />
- - ask the user to answer.<br />
- - compare the users answer to the generated answer.<br />
- - update the amount of correct answers if it is correct.<br />
- end loop.</p>
<p>Then check the amount of correct answers to output the message of congratualtions or not.</p>
<p>Good luck with it.<br /><b>References : </b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2/comment-page-1#comment-6865</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sun, 25 Oct 2009 08:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mathstudenthelp.info/subtraction/would-i-write-the-addition-and-subtraction-in-the-same-algorithm-or-use-branching-2#comment-6865</guid>
		<description>I can't think of an obvious way of doing them both in the same routine.  I suppose if your random numbers can be either positive or negative, you could &#34;accidentally&#34; end up with either addition or subtraction, but it seems like you need to just create a conditional branch for each of the 5 operations.&lt;br&gt;&lt;b&gt;References : &lt;/b&gt;&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>I can&#8217;t think of an obvious way of doing them both in the same routine.  I suppose if your random numbers can be either positive or negative, you could &quot;accidentally&quot; end up with either addition or subtraction, but it seems like you need to just create a conditional branch for each of the 5 operations.<br /><b>References : </b></p>
]]></content:encoded>
	</item>
</channel>
</rss>

