<?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: 5.2 &#8212; If statements</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/52-if-statements/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 21:20:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: ericofilho</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96893</link>
		<dc:creator>ericofilho</dc:creator>
		<pubDate>Wed, 01 Feb 2012 02:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96893</guid>
		<description>Hi. I didn´t understand this example  in chapter 6.7

 if (pnPtr)
    cout &lt;&lt; &quot;pnPtr is pointing to an integer.&quot;;
else
    cout &lt;&lt; &quot;pnPtr is a null pointer.&quot;;


I don´t know what´s the condition for the if statement.

 Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi. I didn´t understand this example  in chapter 6.7</p>
<p> if (pnPtr)<br />
    cout &lt;&lt; &quot;pnPtr is pointing to an integer.&quot;;<br />
else<br />
    cout &lt;&lt; &quot;pnPtr is a null pointer.&quot;;</p>
<p>I don´t know what´s the condition for the if statement.</p>
<p> Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to design your first programs &#171; Learn C++ Programming</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96835</link>
		<dc:creator>How to design your first programs &#171; Learn C++ Programming</dc:creator>
		<pubDate>Fri, 13 Jan 2012 06:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96835</guid>
		<description>[...] To fully complete this example, you’ll need to utilize if statements, which we won’t cover for a while, but you’re welcome to take a sneak-peak at [...]</description>
		<content:encoded><![CDATA[<p>[...] To fully complete this example, you’ll need to utilize if statements, which we won’t cover for a while, but you’re welcome to take a sneak-peak at [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to design your first programs &#124; 4sharesite</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96683</link>
		<dc:creator>How to design your first programs &#124; 4sharesite</dc:creator>
		<pubDate>Sun, 18 Dec 2011 13:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96683</guid>
		<description>[...] To fully complete this example, you’ll need to utilize if statements, which we won’t cover for a while, but you’re welcome to take a sneak-peak at [...]</description>
		<content:encoded><![CDATA[<p>[...] To fully complete this example, you’ll need to utilize if statements, which we won’t cover for a while, but you’re welcome to take a sneak-peak at [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sethradio</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96333</link>
		<dc:creator>sethradio</dc:creator>
		<pubDate>Tue, 08 Nov 2011 04:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96333</guid>
		<description>How do you check if a char variable equals a certain character?</description>
		<content:encoded><![CDATA[<p>How do you check if a char variable equals a certain character?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: luvanlife</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96276</link>
		<dc:creator>luvanlife</dc:creator>
		<pubDate>Wed, 02 Nov 2011 20:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96276</guid>
		<description>ok so wrked on it a little more and now this is what i have now im stuck:


#include 
#include
#include

using namespace std;
int main()
{

	string name;
	char package;
	int hours;
	const double pack_a = 9.95;
	const double pack_b = 14.95;
	const double pack_c = 19.95;
	double total;

	cout&lt;&lt;&quot;Enter customer name:&quot;&lt;&gt; name;
	getline(cin,name);

	cout&lt;&gt;package;

	if (!((package==&#039;A&#039;) &#124;&#124;  (package== &#039;B&#039;) &#124;&#124; (package== &#039;C&#039;)))

		cout&lt;&lt;&quot; Invalid, Available packages are A,B or C, only.&quot;&lt;&lt;endl;

	else {
		cout&lt;&lt;&quot;How many hours were used?&quot;&lt;744){

			cout&lt;&lt; &quot;invalid, hours can not exceed 744&quot;&lt;&lt;endl;
		}
		else if 
			(package==&#039;A&#039;){

				total= (hours-10)*2.00+pack_a;
				cout&lt;&lt;total&lt;&lt;endl;
		}
		else if 
			(package==&#039;B&#039;){


				total=(hours-20)*1.00+pack_b;
				cout&lt;&lt;total&lt;&lt;endl;
		}
		else if (package==&#039;C&#039;)
		{ total==pack_c;

		cout&lt;&lt;total&lt;&lt;endl;</description>
		<content:encoded><![CDATA[<p>ok so wrked on it a little more and now this is what i have now im stuck:</p>
<p>#include<br />
#include<br />
#include</p>
<p>using namespace std;<br />
int main()<br />
{</p>
<p>	string name;<br />
	char package;<br />
	int hours;<br />
	const double pack_a = 9.95;<br />
	const double pack_b = 14.95;<br />
	const double pack_c = 19.95;<br />
	double total;</p>
<p>	cout&lt;&lt;&quot;Enter customer name:&quot;&lt;&gt; name;<br />
	getline(cin,name);</p>
<p>	cout&lt;&gt;package;</p>
<p>	if (!((package==&#8217;A') ||  (package== &#8216;B&#8217;) || (package== &#8216;C&#8217;)))</p>
<p>		cout&lt;&lt;&quot; Invalid, Available packages are A,B or C, only.&quot;&lt;&lt;endl;</p>
<p>	else {<br />
		cout&lt;&lt;&quot;How many hours were used?&quot;&lt;744){</p>
<p>			cout&lt;&lt; &quot;invalid, hours can not exceed 744&quot;&lt;&lt;endl;<br />
		}<br />
		else if<br />
			(package==&#039;A&#039;){</p>
<p>				total= (hours-10)*2.00+pack_a;<br />
				cout&lt;&lt;total&lt;&lt;endl;<br />
		}<br />
		else if<br />
			(package==&#039;B&#039;){</p>
<p>				total=(hours-20)*1.00+pack_b;<br />
				cout&lt;&lt;total&lt;&lt;endl;<br />
		}<br />
		else if (package==&#039;C&#039;)<br />
		{ total==pack_c;</p>
<p>		cout&lt;&lt;total&lt;&lt;endl;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: luvanlife</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96275</link>
		<dc:creator>luvanlife</dc:creator>
		<pubDate>Wed, 02 Nov 2011 20:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96275</guid>
		<description>i forgot to type #include 
and so forth in the previos post.. i know that much lol</description>
		<content:encoded><![CDATA[<p>i forgot to type #include<br />
and so forth in the previos post.. i know that much lol</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: luvanlife</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96274</link>
		<dc:creator>luvanlife</dc:creator>
		<pubDate>Wed, 02 Nov 2011 20:10:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96274</guid>
		<description>hi everyone. I am super new to programming and am trying to write a program for an assignmet but am having a really hard time., i am hoping someone can take a look at what i have to far and maybe steer me in the right direction. i have a test next week and i feel overwhelmed.. ok so the assignmemt is :An Internet service provider has three different subscription packages for its customers:

Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.

Package B: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.

Package C: For $19.95 per month unlimited access is provided.

Write a program that calculates a customer’s monthly bill. It should input customer name, which package the customer has purchased, and how many hours were used. It should then create a bill that includes the input information and the total amount due. The bill should be written to a file.

Input Validation: Be sure the user only selects package A, B, or C. Also, the number of hours used in a month cannot exceed 744.

21. 
Modify the program in problem 20 so it also displays how much money Package A customers would save if they purchased packages B or C, and how much money package B customers would save if they purchased package C. If there would be no savings, no message should be printed......
this is what i have so far...



#include 
#include
#include

using namespace std;
int main()
{

	string name;
	char package;
	int hours;
	const double pack_a = 9.95;
	const double pack_b = 14.95;
	const double pack_c = 19.95;
	float total;

	cout&lt;&lt;&quot;Enter customer name:&quot;&lt;&gt; name;
	getline(cin,name);

	cout&lt;&gt;package;

	if (!((package==&#039;A&#039;) &#124;&#124;  (package== &#039;B&#039;) &#124;&#124; (package== &#039;C&#039;)))

		cout&lt;&lt;&quot; Invalid, Available packages are A,B or C, only.&quot;&lt;&lt;endl;

	else
		cout&lt;&lt;&quot;How many hours were used?&quot;&lt;744)

		cout&lt;&lt; &quot;invalid, hours can not exceed 744&quot;&lt;&lt;endl;

	else if 
		(package==&#039;A&#039;)

		total= (hours-10)*2.00;
	cout&lt;&lt;total&lt;&lt;endl;

	if 
		(package==&#039;B&#039;)

		total=(hours-20)*1.00;















	system (&quot;pause&quot;);
	return 0; 

}</description>
		<content:encoded><![CDATA[<p>hi everyone. I am super new to programming and am trying to write a program for an assignmet but am having a really hard time., i am hoping someone can take a look at what i have to far and maybe steer me in the right direction. i have a test next week and i feel overwhelmed.. ok so the assignmemt is :An Internet service provider has three different subscription packages for its customers:</p>
<p>Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.</p>
<p>Package B: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.</p>
<p>Package C: For $19.95 per month unlimited access is provided.</p>
<p>Write a program that calculates a customer’s monthly bill. It should input customer name, which package the customer has purchased, and how many hours were used. It should then create a bill that includes the input information and the total amount due. The bill should be written to a file.</p>
<p>Input Validation: Be sure the user only selects package A, B, or C. Also, the number of hours used in a month cannot exceed 744.</p>
<p>21.<br />
Modify the program in problem 20 so it also displays how much money Package A customers would save if they purchased packages B or C, and how much money package B customers would save if they purchased package C. If there would be no savings, no message should be printed&#8230;&#8230;<br />
this is what i have so far&#8230;</p>
<p>#include<br />
#include<br />
#include</p>
<p>using namespace std;<br />
int main()<br />
{</p>
<p>	string name;<br />
	char package;<br />
	int hours;<br />
	const double pack_a = 9.95;<br />
	const double pack_b = 14.95;<br />
	const double pack_c = 19.95;<br />
	float total;</p>
<p>	cout&lt;&lt;&quot;Enter customer name:&quot;&lt;&gt; name;<br />
	getline(cin,name);</p>
<p>	cout&lt;&gt;package;</p>
<p>	if (!((package==&#8217;A') ||  (package== &#8216;B&#8217;) || (package== &#8216;C&#8217;)))</p>
<p>		cout&lt;&lt;&quot; Invalid, Available packages are A,B or C, only.&quot;&lt;&lt;endl;</p>
<p>	else<br />
		cout&lt;&lt;&quot;How many hours were used?&quot;&lt;744)</p>
<p>		cout&lt;&lt; &quot;invalid, hours can not exceed 744&quot;&lt;&lt;endl;</p>
<p>	else if<br />
		(package==&#039;A&#039;)</p>
<p>		total= (hours-10)*2.00;<br />
	cout&lt;&lt;total&lt;&lt;endl;</p>
<p>	if<br />
		(package==&#039;B&#039;)</p>
<p>		total=(hours-20)*1.00;</p>
<p>	system (&quot;pause&quot;);<br />
	return 0; </p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: george</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96182</link>
		<dc:creator>george</dc:creator>
		<pubDate>Sun, 23 Oct 2011 09:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96182</guid>
		<description>uh, now its correct. May be my mistake</description>
		<content:encoded><![CDATA[<p>uh, now its correct. May be my mistake</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: george</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-96181</link>
		<dc:creator>george</dc:creator>
		<pubDate>Sun, 23 Oct 2011 09:19:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-96181</guid>
		<description>Alex,

you gotta fix the first program snippet. The inequality sign should be reversed.

I suppose these errors are left due to reverting to older site version after the cyber attacks.</description>
		<content:encoded><![CDATA[<p>Alex,</p>
<p>you gotta fix the first program snippet. The inequality sign should be reversed.</p>
<p>I suppose these errors are left due to reverting to older site version after the cyber attacks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/52-if-statements/comment-page-1/#comment-95754</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 19 Jul 2011 11:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/52-if-statements/#comment-95754</guid>
		<description>Yes it is, though your example is bad, as it can be done with a single if parameter. 
but here&#039;s an example -

bool something (bool a, bool b)
{ if ( a == true &amp;&amp; b == false )
 {                   do something();
                      return true;
 }
}</description>
		<content:encoded><![CDATA[<p>Yes it is, though your example is bad, as it can be done with a single if parameter.<br />
but here&#8217;s an example -</p>
<p>bool something (bool a, bool b)<br />
{ if ( a == true &amp;&amp; b == false )<br />
 {                   do something();<br />
                      return true;<br />
 }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

