<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>reviewmylife</title>
	
	<link>http://www.reviewmylife.co.uk/blog</link>
	<description>Programming, technology and general banter.</description>
	<pubDate>Tue, 07 Oct 2008 06:14:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/reviewmylife" type="application/rss+xml" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/reviewmylife" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Freviewmylife" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Find out the cost of calling any telephone number</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/413538040/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/10/07/find-out-the-cost-of-calling-any-telephone-number/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 06:14:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Money]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=336</guid>
		<description><![CDATA[Often you will see UK telephone numbers with codes such as 087xx, and a price for calling that number will be listed. How do you know that the price is actually correct?
I would have thought the BT would have a simple page where you can enter a telephone number into a box and be told [...]]]></description>
			<content:encoded><![CDATA[<p>Often you will see UK telephone numbers with codes such as 087xx, and a price for calling that number will be listed. How do you know that the price is actually correct?</p>
<p>I would have thought the BT would have a simple page where you can enter a telephone number into a box and be told instantly the correct cost of calling it. I&#8217;ve been unable to find such a page but I have (after a fair bit of searching) managed to find out how to get this information from BT&#8217;s web site. I wanted the information from BT&#8217;s website as it is more likely to be accurate and up to date than from any other site.</p>
<p>I was prompted to find out how to do this as I wanted to be sure of the cost of an access number for calling a Japaneese mobile phone. The web page of the dialing company told me it would cost 7p / minute.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/1005/0871-call-cost.gif" border="0" width="402" height="94" alt="0871 call cost" /></p>
<p>Looking up the price seems to be a two stage process. You need to find the Tariff Guide on their <a href="http://www.productsandservices.bt.com/consumerProducts/displayTopic.do?topicId=15718&#038;s_cid=con_FURL_personal/pricing" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.productsandservices.bt.com/consumerProducts/displayTopic.do?topicId=15718&#038;s_cid=con_FURL_personal/pricing');">Products and Services page</a> in the Personal section of their site. </p>
<p>You need to click on the <a href="http://www.productsandservices.bt.com/consumer/consumerProducts/pdf/SpecialisedNos.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.productsandservices.bt.com/consumer/consumerProducts/pdf/SpecialisedNos.pdf');">Residential and Business special number call prices PDF</a> link under the Pricing information heading.</p>
<p>This document has a large list of the starting codes of all phone numbers. You need to search through this list until you find the one that matches the number you have. You then need to make a note of the &#8216;Type of call&#8217; code. In my case it is &#8216;g13&#8242;.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/1005/telephone-number-lookup.gif" border="0" width="289" height="185" alt="telephone number lookup" /></p>
<p>Further down the document you will find another table that tells you the cost of calling each &#8216;Type of call&#8217; number. By cross-referencing these two pieces of information I&#8217;ve confirmed that the number is correctly advertised as costing 7p / minute.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/1005/call-cost-table.gif" border="0" width="434" height="98" alt="call cost table" /></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F10%2F07%2Ffind-out-the-cost-of-calling-any-telephone-number%2F';
  addthis_title  = 'Find+out+the+cost+of+calling+any+telephone+number';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/10/07/find-out-the-cost-of-calling-any-telephone-number/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=lY8GmC"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=lY8GmC" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=GdibM"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=GdibM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=TWlkm"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=TWlkm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=zg1Tm"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=zg1Tm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=CnHNm"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=CnHNm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=UcZXM"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=UcZXM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=dOTVM"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=dOTVM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=dV0lM"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=dV0lM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/413538040" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/10/07/find-out-the-cost-of-calling-any-telephone-number/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/10/07/find-out-the-cost-of-calling-any-telephone-number/</feedburner:origLink></item>
		<item>
		<title>Triangle Identification - C++ solution and test code</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/400547900/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/09/23/triangle-identification-c-solution-and-test-code/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 06:27:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[C++]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[interview question]]></category>

		<category><![CDATA[solution]]></category>

		<category><![CDATA[source]]></category>

		<category><![CDATA[source code]]></category>

		<category><![CDATA[test code]]></category>

		<category><![CDATA[triangle identification]]></category>

		<category><![CDATA[triangle type]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=234</guid>
		<description><![CDATA[Here is another interview coding question that I have heard of.
You have to write a function to identify the triangle type. You have to return a number between 1 or 4 to identify either a valid triangle type or an error.
The solution is very simple requiring only one condensed line of code to identify each [...]]]></description>
			<content:encoded><![CDATA[<p>Here is another interview coding question that I have heard of.</p>
<p>You have to write a function to identify the triangle type. You have to return a number between 1 or 4 to identify either a valid triangle type or an error.</p>
<p>The solution is very simple requiring only one condensed line of code to identify each triangle type. Two lines of code identify error cases. One of the error cases identifies input with 0 or negative lengths. The other error case identifies line lengths that don&#8217;t make a triangle or which make a segment (thanks to Yabba for pointing out these error cases). </p>
<p>As an exercise you could try to extend the solution to identify right-angled triangles as well.</p>
<pre>
<font color="#0000ff">const</font><font color="#0000ff"> int</font> SCALENE<b><font color="#000000"> =</font></b><font color="#000000"> 1</font><b><font color="#000000">;</font></b><font color="#0000ff">
const</font><font color="#0000ff"> int</font> ISOSCELES<b><font color="#000000"> =</font></b><font color="#000000"> 2</font><b><font color="#000000">;</font></b><font color="#0000ff">
const</font><font color="#0000ff"> int</font> EQUILATERAL<b><font color="#000000"> =</font></b><font color="#000000"> 3</font><b><font color="#000000">;</font></b><font color="#0000ff">
const</font><font color="#0000ff"> int</font> ERROR<b><font color="#000000"> =</font></b><font color="#000000"> 4</font><b><font color="#000000">;</font></b><font color="#0000ff">

int</font> TriangleType<b><font color="#000000">(</font></b><font color="#0000ff">int</font> x<b><font color="#000000">,</font></b><font color="#0000ff"> int</font> y<b><font color="#000000">,</font></b><font color="#0000ff"> int</font> z<b><font color="#000000">)
{</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> ((</font></b>x<b><font color="#000000"> +</font></b> y<b><font color="#000000"> &lt;=</font></b> z<b><font color="#000000">) || (</font></b>x<b><font color="#000000"> +</font></b> z<b><font color="#000000"> &lt;=</font></b> y<b><font color="#000000">) || (</font></b>z<b><font color="#000000"> +</font></b> y<b><font color="#000000"> &lt;=</font></b> x<b><font color="#000000">))</font></b><font color="#0000ff"> return</font> ERROR<b><font color="#000000">;</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>x<b><font color="#000000">&lt;=</font></b><font color="#000000">0</font><b><font color="#000000"> ||</font></b> y<b><font color="#000000">&lt;=</font></b><font color="#000000">0</font><b><font color="#000000"> ||</font></b> z<b><font color="#000000">&lt;=</font></b><font color="#000000">0</font><b><font color="#000000">)</font></b><font color="#0000ff"> return</font> ERROR<b><font color="#000000">;</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>x<b><font color="#000000"> ==</font></b> y<b><font color="#000000"> &amp;&amp;</font></b> y<b><font color="#000000"> ==</font></b> z<b><font color="#000000">)</font></b><font color="#0000ff"> return</font> EQUILATERAL<b><font color="#000000">;</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>x<b><font color="#000000"> ==</font></b> y<b><font color="#000000"> ||</font></b> y<b><font color="#000000"> ==</font></b> z<b><font color="#000000"> ||</font></b> z<b><font color="#000000"> ==</font></b> x<b><font color="#000000">)</font></b><font color="#0000ff"> return</font> ISOSCELES<b><font color="#000000">;</font></b><font color="#0000ff">
	return</font> SCALENE<b><font color="#000000">;
}</font></b>
</pre>
<p>The more interesting code comes from testing the function. To test the function I pass in a series of triangle side lengths. I also pass in the expected result. If the actual result matches the expected result then the test passes. </p>
<p>The test data is written in a way that allows each test to be defined in a single line of code which makes it very easy to extend.</p>
<p>This easy extendibility was fortunate as my original version of this solution missed out the cases where the line lengths don&#8217;t make a triangle (e.g. 1, 1, 5), and where the line lengths make a segment (e.g. 2, 2, 4).</p>
<pre>
<font color="#0000ff">void</font> TriangleTest<b><font color="#000000">()
{</font></b><font color="#0000ff">
const</font><font color="#0000ff"> int</font> testDataSize<b><font color="#000000"> =</font></b><font color="#000000"> 14</font><b><font color="#000000">;</font></b><font color="#0000ff">

int</font> testData<b><font color="#000000">[</font></b>testDataSize<b><font color="#000000">][</font></b><font color="#000000">4</font><b><font color="#000000">] = {
	{</font></b><font color="#000000">9</font><b><font color="#000000">,</font></b><font color="#000000"> 9</font><b><font color="#000000">,</font></b><font color="#000000"> 9</font><b><font color="#000000">,</font></b> EQUILATERAL<b><font color="#000000">},
	{</font></b><font color="#000000">4</font><b><font color="#000000">,</font></b><font color="#000000"> 5</font><b><font color="#000000">,</font></b><font color="#000000"> 5</font><b><font color="#000000">,</font></b> ISOSCELES<b><font color="#000000">},
	{</font></b><font color="#000000">5</font><b><font color="#000000">,</font></b><font color="#000000"> 4</font><b><font color="#000000">,</font></b><font color="#000000"> 5</font><b><font color="#000000">,</font></b> ISOSCELES<b><font color="#000000">},
	{</font></b><font color="#000000">5</font><b><font color="#000000">,</font></b><font color="#000000"> 3</font><b><font color="#000000">,</font></b><font color="#000000"> 3</font><b><font color="#000000">,</font></b> ISOSCELES<b><font color="#000000">},
	{</font></b><font color="#000000">0</font><b><font color="#000000">,</font></b><font color="#000000"> 0</font><b><font color="#000000">,</font></b><font color="#000000"> 0</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},</font></b><i><font color="#009900"> // 0 number checks
</font></i><b><font color="#000000">	{</font></b><font color="#000000">0</font><b><font color="#000000">,</font></b><font color="#000000"> 1</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 0</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b><font color="#000000"> 0</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{-</font></b><font color="#000000">1</font><b><font color="#000000">, -</font></b><font color="#000000">1</font><b><font color="#000000">, -</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},</font></b><i><font color="#009900"> // negative number checks
</font></i><b><font color="#000000">	{-</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 1</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{</font></b><font color="#000000">1</font><b><font color="#000000">, -</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">, -</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},
	{</font></b><font color="#000000">2</font><b><font color="#000000">,</font></b><font color="#000000"> 2</font><b><font color="#000000">,</font></b><font color="#000000"> 4</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">},</font></b><i><font color="#009900"> // line segment not a triangle
</font></i><b><font color="#000000">	{</font></b><font color="#000000">1</font><b><font color="#000000">,</font></b><font color="#000000"> 1</font><b><font color="#000000">,</font></b><font color="#000000"> 5</font><b><font color="#000000">,</font></b> ERROR<b><font color="#000000">}</font></b><i><font color="#009900"> // not a triangle
</font></i><b><font color="#000000">};</font></b><font color="#0000ff">

for</font><b><font color="#000000"> (</font></b><font color="#0000ff">int</font> i<b><font color="#000000">=</font></b><font color="#000000">0</font><b><font color="#000000">;</font></b> i<b><font color="#000000">&lt;</font></b>testDataSize<b><font color="#000000">; ++</font></b>i<b><font color="#000000">)
{</font></b><font color="#0000ff">
	int</font> result<b><font color="#000000"> =</font></b> TriangleType<b><font color="#000000">(</font></b>
		testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">0</font><b><font color="#000000">],</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">1</font><b><font color="#000000">],</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">2</font><b><font color="#000000">]);</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>result<b><font color="#000000"> ==</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">3</font><b><font color="#000000">])
	{</font></b>
		cout<b><font color="#000000"> &lt;&lt;</font></b><font color="#990000"> " Pass: triangleType("</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">0</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ", "</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">1</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ", "</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">2</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ")=="</font><b><font color="#000000"> &lt;&lt;</font></b> result<b><font color="#000000"> &lt;&lt;</font></b> endl<b><font color="#000000">;
	}</font></b><font color="#0000ff">
	else</font><b><font color="#000000">
	{</font></b>
		cout<b><font color="#000000"> &lt;&lt;</font></b><font color="#990000"> "!Fail: triangleType("</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">0</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ", "</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">1</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ", "</font><b><font color="#000000">
			&lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">2</font><b><font color="#000000">] &lt;&lt;</font></b><font color="#990000"> ")=="</font><b><font color="#000000"> &lt;&lt;</font></b> result<b><font color="#000000">
			&lt;&lt;</font></b><font color="#990000"> " Expected: "</font><b><font color="#000000"> &lt;&lt;</font></b> testData<b><font color="#000000">[</font></b>i<b><font color="#000000">][</font></b><font color="#000000">3</font><b><font color="#000000">] &lt;&lt;</font></b> endl<b><font color="#000000">;
	}
}
}</font></b>
</pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F09%2F23%2Ftriangle-identification-c-solution-and-test-code%2F';
  addthis_title  = 'Triangle+Identification+-+C%2B%2B+solution+and+test+code';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/09/23/triangle-identification-c-solution-and-test-code/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=nj25tv"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=nj25tv" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=eiQQL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=eiQQL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=ZPUXl"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=ZPUXl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=J95ql"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=J95ql" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=SX1ul"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=SX1ul" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=k3r4L"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=k3r4L" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=FvomL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=FvomL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=YzkaL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=YzkaL" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/400547900" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/09/23/triangle-identification-c-solution-and-test-code/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/09/23/triangle-identification-c-solution-and-test-code/</feedburner:origLink></item>
		<item>
		<title>Reverse the words in a sentence - C++ solution and test code</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/393932045/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/09/16/reverse-the-words-in-a-sentence-c-solution-and-test-code/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 06:21:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[C++]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[interview question]]></category>

		<category><![CDATA[reverse a string]]></category>

		<category><![CDATA[reverse string]]></category>

		<category><![CDATA[reverse words]]></category>

		<category><![CDATA[solution]]></category>

		<category><![CDATA[source]]></category>

		<category><![CDATA[source code]]></category>

		<category><![CDATA[test code]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=236</guid>
		<description><![CDATA[Here is a solution to the standard interview questions of reversing the letters in the words of a sentence. It is a more complex version of the even more common &#8220;reverse a string&#8221; question. I also include my test code.
There are two main parts to this. The first identifies where the word boundaries are. The [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a solution to the standard interview questions of reversing the letters in the words of a sentence. It is a more complex version of the even more common &#8220;reverse a string&#8221; question. I also include my test code.</p>
<p>There are two main parts to this. The first identifies where the word boundaries are. The second reverses the letters between two positions in the array.</p>
<p>The wordStart and wordEnd variables keep track of the word boundaries. We first look for the start of the word and then the end and store the positions. These values are then passed to ReverseWord along with the character array. ReverseWord does some simple character swapping to reverse the word.</p>
<pre>
<font color="#0000ff">void</font> ReverseWords<b><font color="#000000">(</font></b><font color="#0000ff">char</font> string<b><font color="#000000">[])
{</font></b><font color="#0000ff">
	int</font> length<b><font color="#000000"> =</font></b> StringLength<b><font color="#000000">(</font></b>string<b><font color="#000000">);</font></b><font color="#0000ff">
	int</font> wordStart<b><font color="#000000"> = -</font></b><font color="#000000">1</font><b><font color="#000000">;</font></b><font color="#0000ff">
	int</font> wordEnd<b><font color="#000000"> = -</font></b><font color="#000000">1</font><b><font color="#000000">;</font></b><font color="#0000ff">
	for</font><b><font color="#000000"> (</font></b><font color="#0000ff">int</font> i<b><font color="#000000">=</font></b><font color="#000000">0</font><b><font color="#000000">;</font></b> i<b><font color="#000000">&lt;</font></b>length<b><font color="#000000">; ++</font></b>i<b><font color="#000000">)
	{</font></b><font color="#0000ff">
		if</font><b><font color="#000000"> (</font></b>string<b><font color="#000000">[</font></b>i<b><font color="#000000">] ==</font></b><font color="#990000"> ' '</font><b><font color="#000000"> &amp;&amp;</font></b> wordStart<b><font color="#000000"> == -</font></b><font color="#000000">1</font><b><font color="#000000">)
		{</font></b><font color="#0000ff">
			continue</font><b><font color="#000000">;
		}</font></b><font color="#0000ff">
		else if</font><b><font color="#000000"> (</font></b>wordStart<b><font color="#000000"> == -</font></b><font color="#000000">1</font><b><font color="#000000">)
		{</font></b>
			wordStart<b><font color="#000000"> =</font></b> i<b><font color="#000000">;
		}</font></b><font color="#0000ff">
		if</font><b><font color="#000000"> (</font></b>wordStart<b><font color="#000000"> != -</font></b><font color="#000000">1</font><b><font color="#000000"> &amp;&amp;</font></b> string<b><font color="#000000">[</font></b>i<b><font color="#000000">] ==</font></b><font color="#990000"> ' '</font><b><font color="#000000">)
		{</font></b>
			wordEnd<b><font color="#000000"> =</font></b> i<b><font color="#000000">-</font></b><font color="#000000">1</font><b><font color="#000000">;</font></b>
			ReverseWord<b><font color="#000000">(</font></b>string<b><font color="#000000">,</font></b> wordStart<b><font color="#000000">,</font></b> wordEnd<b><font color="#000000">);</font></b>
			wordStart<b><font color="#000000"> = -</font></b><font color="#000000">1</font><b><font color="#000000">;</font></b>
			wordEnd<b><font color="#000000"> = -</font></b><font color="#000000">1</font><b><font color="#000000">;
		}
	}</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>wordStart<b><font color="#000000"> != -</font></b><font color="#000000">1</font><b><font color="#000000">)
	{</font></b>
		wordEnd<b><font color="#000000"> =</font></b> length<b><font color="#000000">-</font></b><font color="#000000">1</font><b><font color="#000000">;</font></b>
		ReverseWord<b><font color="#000000">(</font></b>string<b><font color="#000000">,</font></b> wordStart<b><font color="#000000">,</font></b> wordEnd<b><font color="#000000">);
	}
}</font></b><font color="#0000ff">

void</font> ReverseWord<b><font color="#000000">(</font></b><font color="#0000ff">char</font> string<b><font color="#000000">[],</font></b><font color="#0000ff"> int</font> wordStart<b><font color="#000000">,</font></b><font color="#0000ff"> int</font> wordEnd<b><font color="#000000">)
{</font></b><font color="#0000ff">
	int</font> midPoint<b><font color="#000000"> = (</font></b>wordStart<b><font color="#000000">+</font></b>wordEnd<b><font color="#000000">)/</font></b><font color="#000000">2</font><b><font color="#000000">;</font></b><font color="#0000ff">
	for</font><b><font color="#000000"> (</font></b><font color="#0000ff">int</font> l<b><font color="#000000">=</font></b>wordStart<b><font color="#000000">,</font></b> r<b><font color="#000000">=</font></b>wordEnd<b><font color="#000000">;</font></b> l<b><font color="#000000">&lt;=</font></b>midPoint<b><font color="#000000">; ++</font></b>l<b><font color="#000000">, --</font></b>r<b><font color="#000000">)
	{</font></b><font color="#0000ff">
		char</font> tmp<b><font color="#000000"> =</font></b> string<b><font color="#000000">[</font></b>l<b><font color="#000000">];</font></b>
		string<b><font color="#000000">[</font></b>l<b><font color="#000000">] =</font></b> string<b><font color="#000000">[</font></b>r<b><font color="#000000">];</font></b>
		string<b><font color="#000000">[</font></b>r<b><font color="#000000">] =</font></b> tmp<b><font color="#000000">;
	}
}</font></b>
</pre>
<p>Here is the test code. For each test a character array is passed to the word reversing function. The result is then compared against the expected result. If they match the test passes. If they don&#8217;t match then the test fails. I&#8217;ve tried to test the obvious cases. You could easily find flaws in the word reversal function but it is probably good enough to get you onto the next question.</p>
<pre>
<font color="#0000ff">void</font> ReverseWordsTest<b><font color="#000000">()
{</font></b><font color="#0000ff">
	char</font> test1<b><font color="#000000">[] =</font></b><font color="#990000"> "cat and dog"</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected1<b><font color="#000000">[] =</font></b><font color="#990000"> "tac dna god"</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test1<b><font color="#000000">,</font></b> expected1<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test2<b><font color="#000000">[] =</font></b><font color="#990000"> "cat and dog "</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected2<b><font color="#000000">[] =</font></b><font color="#990000"> "tac dna god "</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test2<b><font color="#000000">,</font></b> expected2<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test3<b><font color="#000000">[] =</font></b><font color="#990000"> " cat and dog"</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected3<b><font color="#000000">[] =</font></b><font color="#990000"> " tac dna god"</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test3<b><font color="#000000">,</font></b> expected3<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test4<b><font color="#000000">[] =</font></b><font color="#990000"> " cat and dog "</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected4<b><font color="#000000">[] =</font></b><font color="#990000"> " tac dna god "</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test4<b><font color="#000000">,</font></b> expected4<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test5<b><font color="#000000">[] =</font></b><font color="#990000"> "cat  and dog"</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected5<b><font color="#000000">[] =</font></b><font color="#990000"> "tac  dna god"</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test5<b><font color="#000000">,</font></b> expected5<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test6<b><font color="#000000">[] =</font></b><font color="#990000"> "catanddog"</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected6<b><font color="#000000">[] =</font></b><font color="#990000"> "goddnatac"</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test6<b><font color="#000000">,</font></b> expected6<b><font color="#000000">);</font></b><font color="#0000ff">

	char</font> test7<b><font color="#000000">[] =</font></b><font color="#990000"> ""</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> expected7<b><font color="#000000">[] =</font></b><font color="#990000"> ""</font><b><font color="#000000">;</font></b>
	ReverseAndCheck<b><font color="#000000">(</font></b>test7<b><font color="#000000">,</font></b> expected7<b><font color="#000000">);
}</font></b><font color="#0000ff">

void</font> ReverseAndCheck<b><font color="#000000">(</font></b><font color="#0000ff">char</font> string<b><font color="#000000">[],</font></b><font color="#0000ff"> char</font> expected<b><font color="#000000">[])
{</font></b>
	ReverseWords<b><font color="#000000">(</font></b>string<b><font color="#000000">);</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>MatchingStrings<b><font color="#000000">(</font></b>string<b><font color="#000000">,</font></b> expected<b><font color="#000000">))
	{</font></b>
		cout<b><font color="#000000"> &lt;&lt;</font></b><font color="#990000"> " Pass: "</font><b><font color="#000000"> &lt;&lt;</font></b> string<b><font color="#000000"> &lt;&lt;</font></b> endl<b><font color="#000000">;
	}</font></b><font color="#0000ff">
	else</font><b><font color="#000000">
	{</font></b>
		cout<b><font color="#000000"> &lt;&lt;</font></b><font color="#990000"> "!Fail: "</font><b><font color="#000000"> &lt;&lt;</font></b> string<b><font color="#000000"> &lt;&lt;</font></b><font color="#990000"> " != "</font><b><font color="#000000"> &lt;&lt;</font></b> expected<b><font color="#000000"> &lt;&lt;</font></b> endl<b><font color="#000000">;
	}
}</font></b><font color="#0000ff">

bool</font> MatchingStrings<b><font color="#000000">(</font></b><font color="#0000ff">char</font> string1<b><font color="#000000">[],</font></b><font color="#0000ff"> char</font> string2<b><font color="#000000">[])
{</font></b><font color="#0000ff">
	int</font> length<b><font color="#000000"> =</font></b> StringLength<b><font color="#000000">(</font></b>string1<b><font color="#000000">);</font></b><font color="#0000ff">
	if</font><b><font color="#000000"> (</font></b>length<b><font color="#000000"> !=</font></b> StringLength<b><font color="#000000">(</font></b>string2<b><font color="#000000">))
	{</font></b><font color="#0000ff">
		return</font><b><font color="#000000"> false</font></b><b><font color="#000000">;
	}</font></b><font color="#0000ff">

	for</font><b><font color="#000000"> (</font></b><font color="#0000ff">int</font> i<b><font color="#000000">=</font></b><font color="#000000">0</font><b><font color="#000000">;</font></b> i<b><font color="#000000">&lt;</font></b>length<b><font color="#000000">; ++</font></b>i<b><font color="#000000">)
	{</font></b><font color="#0000ff">
		if</font><b><font color="#000000"> (</font></b>string1<b><font color="#000000">[</font></b>i<b><font color="#000000">] !=</font></b> string2<b><font color="#000000">[</font></b>i<b><font color="#000000">])
		{</font></b><font color="#0000ff">
			return</font><b><font color="#000000"> false</font></b><b><font color="#000000">;
		}
	}</font></b><font color="#0000ff">

	return</font><b><font color="#000000"> true</font></b><b><font color="#000000">;
}</font></b><font color="#0000ff">

int</font> StringLength<b><font color="#000000">(</font></b><font color="#0000ff">char</font> string<b><font color="#000000">[])
{</font></b><font color="#0000ff">
	int</font> index<b><font color="#000000"> =</font></b><font color="#000000"> 0</font><b><font color="#000000">;</font></b><font color="#0000ff">
	char</font> s<b><font color="#000000"> =</font></b> string<b><font color="#000000">[</font></b>index<b><font color="#000000">];</font></b><font color="#0000ff">
	while</font><b><font color="#000000"> (</font></b>s<b><font color="#000000">)
	{
		++</font></b>index<b><font color="#000000">;</font></b>
		s<b><font color="#000000"> =</font></b> string<b><font color="#000000">[</font></b>index<b><font color="#000000">];
	}</font></b><font color="#0000ff">
	return</font> index<b><font color="#000000">;
}</font></b>
</pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F09%2F16%2Freverse-the-words-in-a-sentence-c-solution-and-test-code%2F';
  addthis_title  = 'Reverse+the+words+in+a+sentence+-+C%2B%2B+solution+and+test+code';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/09/16/reverse-the-words-in-a-sentence-c-solution-and-test-code/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=78iWSd"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=78iWSd" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=x3rQL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=x3rQL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=wIIol"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=wIIol" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=vjk2l"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=vjk2l" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=i1BAl"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=i1BAl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=fzExL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=fzExL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=kDASL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=kDASL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=dr9CL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=dr9CL" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/393932045" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/09/16/reverse-the-words-in-a-sentence-c-solution-and-test-code/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/09/16/reverse-the-words-in-a-sentence-c-solution-and-test-code/</feedburner:origLink></item>
		<item>
		<title>2008 - 2009 UK Tax Graphs</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/380453302/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/09/01/2008-2009-uk-tax-graphs/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 12:20:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Money]]></category>

		<category><![CDATA[2008-2009]]></category>

		<category><![CDATA[Excel]]></category>

		<category><![CDATA[graph]]></category>

		<category><![CDATA[graphing]]></category>

		<category><![CDATA[income tax]]></category>

		<category><![CDATA[national insurance]]></category>

		<category><![CDATA[ni]]></category>

		<category><![CDATA[NICs]]></category>

		<category><![CDATA[tax]]></category>

		<category><![CDATA[tax band]]></category>

		<category><![CDATA[uk tax]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=302</guid>
		<description><![CDATA[I&#8217;ve produced some graphs using data about the 2008 - 2009 UK tax situation.
I&#8217;ve tried to make them accurate but beware that I&#8217;m not a tax expert so there could well be errors. They have been created for interest only, not for serious use.
The first graph is showing how much income tax you pay depending [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve produced some graphs using data about the 2008 - 2009 UK tax situation.</p>
<p>I&#8217;ve tried to make them accurate but beware that I&#8217;m not a tax expert so there could well be errors. They have been created for interest only, not for serious use.</p>
<p>The first graph is showing how much income tax you pay depending on how much you earn. This graph is based on the standard un-adjusted tax free allowance of £6305, a 20% band for the next £34800 and 40% after that.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0901/income-tax-08-09.gif" border="0" width="410" height="291" alt="income tax 08 09" /></p>
<p>Next is a similar graph but for national insurance contribution. I&#8217;ve used £105 per week as being free from NICs, 11% for £105-£770 per week and 1% after that.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0901/national-insurance-08-09.gif" border="0" width="404" height="301" alt="national insurance 08 09" /></p>
<p>The third graph combines the total of the two to show the total taxation.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0901/total-tax-08-09.gif" border="0" width="408" height="281" alt="total tax 08 09" /></p>
<p>The final graph shows what percentage of your gross income you pay as tax. The interesting shape is caused by the National Insurance contributions changing to 1% before the 40% tax band kicks in.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0901/percentage-of-income-as-tax-08-09.gif" border="0" width="408" height="293" alt="percentage of income as tax 08 09" /></p>
<p>You may spot that when your salary reaches just over £40k the percentage of salary that you pay in tax actually goes down by a very small amount before going back up again.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F09%2F01%2F2008-2009-uk-tax-graphs%2F';
  addthis_title  = '2008+-+2009+UK+Tax+Graphs';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/09/01/2008-2009-uk-tax-graphs/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=7RBinC"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=7RBinC" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=PbWEYL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=PbWEYL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=5QJvTl"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=5QJvTl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=xifEYl"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=xifEYl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=6Q8MGl"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=6Q8MGl" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=g5BRWL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=g5BRWL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=hFPsyL"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=hFPsyL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=FFnC2L"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=FFnC2L" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/380453302" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/09/01/2008-2009-uk-tax-graphs/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/09/01/2008-2009-uk-tax-graphs/</feedburner:origLink></item>
		<item>
		<title>2009 One Page Excel Calendar</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/377994189/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/08/29/2009-one-page-excel-calendar/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 09:48:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Computing]]></category>

		<category><![CDATA[2009 calendar]]></category>

		<category><![CDATA[2009 excel calendar]]></category>

		<category><![CDATA[2009 planner]]></category>

		<category><![CDATA[calendar]]></category>

		<category><![CDATA[Excel]]></category>

		<category><![CDATA[one page calendar]]></category>

		<category><![CDATA[planner]]></category>

		<category><![CDATA[yearly]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=293</guid>
		<description><![CDATA[Following on from my 2008 Excel one page calendar I&#8217;ve produced a new yearly calendar for 2009.

This time I&#8217;ve done a blank one with just the days / months marked out, and one with the UK bank holidays highlighted.
2009 Excel calendar - blank (7kb)
2009 Excel calendar - with UK Bank Holidays highlighted (7kb)
Like before you [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from my <a href="http://www.reviewmylife.co.uk/blog/2008/01/03/2008-excel-one-page-calendar/" >2008 Excel one page calendar</a> I&#8217;ve produced a new yearly calendar for 2009.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0826/2009-excel-calendar.gif" width="420" height="188" alt="2009 Excel one page calendar"></p>
<p>This time I&#8217;ve done a blank one with just the days / months marked out, and one with the UK bank holidays highlighted.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0826/Calendar2009.zip" onclick="javascript:pageTracker._trackPageview('/downloadsreviewmylife./data/2008/0826/Calendar2009.zip');">2009 Excel calendar</a> - blank (7kb)<br />
<a href="http://www.reviewmylife.co.uk/data/2008/0826/Calendar2009-UK-Bank-Holidays.zip" onclick="javascript:pageTracker._trackPageview('/downloadsreviewmylife./data/2008/0826/Calendar2009-UK-Bank-Holidays.zip');">2009 Excel calendar</a> - with UK Bank Holidays highlighted (7kb)</p>
<p>Like before you should be able to get it to fit on your computer screen without any scrolling - you may need to adjust the box sizes, or zoom level depending on the resolution of your monitor.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F08%2F29%2F2009-one-page-excel-calendar%2F';
  addthis_title  = '2009+One+Page+Excel+Calendar';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/08/29/2009-one-page-excel-calendar/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=HIkH24"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=HIkH24" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=SVcPpK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=SVcPpK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=sxwHPk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=sxwHPk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=aSnF9k"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=aSnF9k" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=wM0pik"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=wM0pik" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=CYuPEK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=CYuPEK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=2NCnaK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=2NCnaK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=15GI2K"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=15GI2K" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/377994189" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/08/29/2009-one-page-excel-calendar/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/08/29/2009-one-page-excel-calendar/</feedburner:origLink></item>
		<item>
		<title>Graphing the AXA Sun Life 50 Plus Protector</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/375937046/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/08/27/graphing-the-axa-sun-life-50-plus-protector/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 06:51:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Money]]></category>

		<category><![CDATA[50 Plus Protector]]></category>

		<category><![CDATA[analysis]]></category>

		<category><![CDATA[AXA Sun Life]]></category>

		<category><![CDATA[AXA Sun Life 50 Plus Protector]]></category>

		<category><![CDATA[Excel]]></category>

		<category><![CDATA[finance]]></category>

		<category><![CDATA[graphing]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=278</guid>
		<description><![CDATA[Following on from my post where I graphed the AXA Sun Life Guaranteed Over 50 plan I thought I&#8217;d look at a more complex product to see what kind of graphs I could get out of it. Unlike the Over 50 plan, the AXA Sun Life 50 Plus Protector features a lump sum and premium [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from my post where I graphed the <a href="http://www.reviewmylife.co.uk/blog/2008/08/22/graphing-the-axa-sun-life-guaranteed-over-50-plan/" >AXA Sun Life Guaranteed Over 50 plan</a> I thought I&#8217;d look at a more complex product to see what kind of graphs I could get out of it. Unlike the Over 50 plan, the <a href="http://www.axa-sunlife.co.uk/50_plus_protector_plan/asld/index.html" >AXA Sun Life 50 Plus Protector</a> features a lump sum and premium that increases over time. There is also a maximum number of years that the premiums are payable for. As there are a number of extra rules it should produce some interesting graphs!</p>
<p>As before I&#8217;ll mention that I&#8217;m not writing this to offer an opinion on this particular product. I&#8217;m not a financial advisor. My interest is to show how you can convert the information about financial product into graphs. These graphs can be of great help in deciding whether a financial product is suitable for you.</p>
<p>I got a quote from their website for a 60 year old male paying in a premium of £7 per month. These figures are what I was quoted on the day I did the quote (late August 2008).</p>
<p>The premium of £7 will rise by £0.35 per year for a maximum of 20 years when it will be double the initial premium. It will then remain level until it stops altogether at the age of 90. The cash lump sum is payable on death after two years. It is £1095 and will rise by £50 per year. If you were to die within two years the lump sum would be 1.5x the amount paid into the plan. There is no cash in value - if you stop paying money into the plan you get nothing.</p>
<p>The first graph I&#8217;ll make is to show how your premiums vary over the years. You can see them increasing every year, until the age of 80 when they level off. After the age of 90 you don&#8217;t pay any more premiums.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0823/axa-sun-life-50-plus-protector-cost-of-premium.gif" border="0" width="377" height="278" alt="axa sun life 50 plus protector cost of premium" /></p>
<p>The next graph shows the cumulative cost of all the premiums paid into the plan, against the value of the lump sum. You can see (if you look carefully) that the premiums paid line increases in angle for the first 20 years. It is then a straight line for the next 10 years. The line then goes flat from age 90 as no more premiums are payable. The lump sum payment starts off at 1.5x the amount of premiums paid in, after two years it goes to the full lump sum value which increases by £50 each year.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0823/axa-sun-life-50-plus-protector-plan-cost-vs-lump-sum.gif" border="0" width="374" height="292" alt="axa sun life 50 plus protector plan cost vs lump sum" /></p>
<p>You can see that there is a crossover point at which you pay more in premiums than the lump sum you get back. You can also see that as you don&#8217;t pay any more premiums after age 90 the lines start coming together again. I continued the age range to 120 to see at what point they diverge for the second time.</p>
<p>I then produced a graph to show by what percentage the lump sum and the premiums go up. The text on their website says that both go up by 5% of the original lump sum / premium each year. An increase of £0.35 is indeed 5% of the £7 premium. However £50 of £1095 is actually 4.6%. I&#8217;m not sure whether they are rounding the lump sum increase down, or whether there is some error in their calculation.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0823/axa-sun-life-50-plus-protector-lump-sum-increase.gif" border="0" width="381" height="289" alt="axa sun life 50 plus protector lump sum increase" /></p>
<p>Despite the slight discrepancy in percentages both premium and lump sum follow an almost identical curve of decreasing percentage increases each year. The premium increases drop to 0% after the age of 80 as per the plan description. The lump sum increases by £50 each year so the percentage increase keeps dropping. It is therefore important to understand the effect that inflation will have on this plan.</p>
<p>I hope you found this interesting. These three graphs took me about 15 minutes to do and provide details of this product in a much easier to analyse format than the pure text description of the product as given on the AXA page. </p>
<p>As I started before I&#8217;m not offering you an opinion of their plan, more a reason why getting to grips with a spreadsheet package like Microsoft Excel will help you with making financial decision.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F08%2F27%2Fgraphing-the-axa-sun-life-50-plus-protector%2F';
  addthis_title  = 'Graphing+the+AXA+Sun+Life+50+Plus+Protector';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/08/27/graphing-the-axa-sun-life-50-plus-protector/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=12mF4Q"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=12mF4Q" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=HT4p5K"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=HT4p5K" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=InWvqk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=InWvqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=oryP9k"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=oryP9k" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=5I4YHk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=5I4YHk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=I191MK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=I191MK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=VW3mwK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=VW3mwK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=8H1wdK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=8H1wdK" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/375937046" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/08/27/graphing-the-axa-sun-life-50-plus-protector/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/08/27/graphing-the-axa-sun-life-50-plus-protector/</feedburner:origLink></item>
		<item>
		<title>HMS Belfast visit in London</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/375107172/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/08/26/hms-belfast-visit-in-london/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 09:37:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[boat]]></category>

		<category><![CDATA[day out]]></category>

		<category><![CDATA[HMS Belfast]]></category>

		<category><![CDATA[navy]]></category>

		<category><![CDATA[River Thames]]></category>

		<category><![CDATA[ship]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=269</guid>
		<description><![CDATA[As it was a bank holiday weekend I decided to visit the HMS Belfast. It was a Royal Navy warship, which is now permanently moored in the Thames as a museum. You&#8217;ll find it near London Bridge tube station.
 
It served in World War II and for around 20 years afterwards. You can explore the [...]]]></description>
			<content:encoded><![CDATA[<p>As it was a bank holiday weekend I decided to visit the <a href="http://en.wikipedia.org/wiki/Hms_belfast" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://en.wikipedia.org/wiki/Hms_belfast');">HMS Belfast</a>. It was a Royal Navy warship, which is now permanently moored in the Thames as a museum. You&#8217;ll find it near London Bridge tube station.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-exterior-01_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-exterior-01_th.jpg" border="0" width="206" height="163" alt="hms belfast exterior 01_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-anti-aircraft-gun-13_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-anti-aircraft-gun-13_th.jpg" border="0" width="206" height="163" alt="hms belfast anti aircraft gun 13_th" /></a></p>
<p>It served in World War II and for around 20 years afterwards. You can explore the ship seven days a week. On the day I visited it was £10.30 for an adult ticket.</p>
<p>Inside you&#8217;ll find lots of scenes of life inside the ship, including the gramophone room and the kitchens. You&#8217;ll also find a few exhibitions and plenty of information for you to read about the various areas of the ship.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-radio-room-02_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-radio-room-02_th.jpg" border="0" width="216" height="175" alt="hms belfast radio room 02_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-kitchen-03_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-kitchen-03_th.jpg" border="0" width="208" height="163" alt="hms belfast kitchen 03_th" /></a></p>
<p>You&#8217;ll need to be comfortable with climbing up and down these kinds of ladders if you want to get around the ship. If you have a rucksack you&#8217;ll need to be careful when going through these openings.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-stairs-04_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-stairs-04_th.jpg" border="0" width="214" height="171" alt="hms belfast stairs 04_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-stairs-08_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-stairs-08_th.jpg" border="0" width="208" height="163" alt="hms belfast stairs 08_th" /></a></p>
<p>You get given a map of the ship and you are supposed to follow the red arrows to get around the route. Unfortunately there are so many red arrows, often pointing in opposite directions that it is very easy to get lost. If they put some numbers on the arrows it would be much easier to follow the route.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-machinery-05_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-machinery-05_th.jpg" border="0" width="224" height="280" alt="hms belfast machinery 05_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-guages-06_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-guages-06_th.jpg" border="0" width="212" height="169" alt="hms belfast guages 06_th" /></a></p>
<p>The ship had its own surgery where injured sailors could be treated.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-indicator-07_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-indicator-07_th.jpg" border="0" width="218" height="175" alt="hms belfast indicator 07_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-surgery-09_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-surgery-09_th.jpg" border="0" width="218" height="177" alt="hms belfast surgery 09_th" /></a></p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-steering-wheel-10_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-steering-wheel-10_th.jpg" border="0" width="214" height="171" alt="hms belfast steering wheel 10_th" /></a></p>
<p>The average sailor had to sleep in hammocks wherever there was space for them to be hung. Often they would have to sleep in rooms full of very noisy equipment. In the photo on the right is one of the rooms that houses the shells that can be fired 14 miles by the ship’s guns.</p>
<p><a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-sleeping-sailor-11_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-sleeping-sailor-11_th.jpg" border="0" width="218" height="179" alt="hms belfast sleeping sailor 11_th" /></a> <a href="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-shells-for-guns-12_full.jpg"  target="_blank"><img src="http://www.reviewmylife.co.uk/data/2008/0825/hms-belfast-shells-for-guns-12_th.jpg" border="0" width="222" height="181" alt="hms belfast shells for guns 12_th" /></a></p>
<p>I spent around one and a half-hours on the boat. If you were to read all the information, watch all the videos and listen to all the information on the audio guide you could double this. If you&#8217;ve never been to the HMS Belfast and you are in London it is definitely worth a visit.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F08%2F26%2Fhms-belfast-visit-in-london%2F';
  addthis_title  = 'HMS+Belfast+visit+in+London';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/08/26/hms-belfast-visit-in-london/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=9Etwcm"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=9Etwcm" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=ZEyyrK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=ZEyyrK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=xnwNTk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=xnwNTk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=AqS7Nk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=AqS7Nk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=lnxU2k"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=lnxU2k" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=PiyK4K"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=PiyK4K" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=hOaNaK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=hOaNaK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=4aBNFK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=4aBNFK" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/375107172" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/08/26/hms-belfast-visit-in-london/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/08/26/hms-belfast-visit-in-london/</feedburner:origLink></item>
		<item>
		<title>Graphing the AXA Sun Life Guaranteed Over 50 Plan</title>
		<link>http://feeds.feedburner.com/~r/reviewmylife/~3/372047460/</link>
		<comments>http://www.reviewmylife.co.uk/blog/2008/08/22/graphing-the-axa-sun-life-guaranteed-over-50-plan/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 17:02:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Money]]></category>

		<category><![CDATA[AXA Sun Life]]></category>

		<category><![CDATA[AXA Sun Life Guaranteed Over 50 Plan]]></category>

		<category><![CDATA[compound interest]]></category>

		<category><![CDATA[Excel]]></category>

		<category><![CDATA[graph]]></category>

		<category><![CDATA[graphing]]></category>

		<category><![CDATA[Guaranteed Over 50 Plan]]></category>

		<category><![CDATA[interest]]></category>

		<category><![CDATA[life expectancy]]></category>

		<category><![CDATA[savings]]></category>

		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=253</guid>
		<description><![CDATA[On TV recently I&#8217;ve been bombarded by adverts about the AXA Sun Life Guaranteed Over 50 Plan. The current version of the advert is presented by Michael Parkinson. Previous versions have been presented by June Whitfield.
I am no way near the age of 50 and these plans have no relevance to me. I should also [...]]]></description>
			<content:encoded><![CDATA[<p>On TV recently I&#8217;ve been bombarded by adverts about the <a href="https://www.axa-sunlife.co.uk/guaranteed_over_50_plan/asld/index.html" >AXA Sun Life Guaranteed Over 50 Plan</a>. The current version of the advert is presented by Michael Parkinson. Previous versions have been presented by June Whitfield.</p>
<p>I am no way near the age of 50 and these plans have no relevance to me. I should also point out that I am not a financial advisor, and am not intending to offer any opinion on these plans. My interest is to look at them from a simple mathematical point of view.</p>
<p>In case you&#8217;ve missed the advert the basic idea is this. If you are over 50 you can pay AXA a fixed monthly sum for the rest of your life. When you die a fixed sum (fixed at the time you open the plan) is payable to your family. If you die within two years you don&#8217;t get the fixed sum, but your family do get 1.5x your premiums back. If you ever stop contributing you don&#8217;t get anything.</p>
<p>I went on their website and got a quote for a 60 year old male paying in £6 per month (the minimum a 60 year old male can pay in on the day I got the quote). This produces a cash lump sum of £760, payable on death after 2 years. </p>
<p>Here is a graph plotting how much you pay in, against how much you get back. You can see there is a cross-over point at which you end up paying in more money than you get back. In this case you end up having paid in more then you&#8217;d get out when you reach 71 years old.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0821/axa-sun-life-over-50-plan-graph.gif" border="0" width="420" height="271" alt="axa sun life over 50 plan graph" /></p>
<p>The government publish data on <a href="http://www.gad.gov.uk/Demography_Data/Life_Tables/Interim_life_tables.asp" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.gad.gov.uk/Demography_Data/Life_Tables/Interim_life_tables.asp');">life expectancy</a>. I got the latest male life expectancy data from 2004 and 2006 and plotted this into another graph. Note how your life expectancy goes up as you get older. This is because you have already managed to avoid dying in the preceeding years.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0821/uk-life-expectancy.gif" border="0" width="431" height="348" alt="uk life expectancy" /></p>
<p>You might not be able to make out the detail on the graph but the life expectance for a 60 year old male in the UK is 80.81 years.</p>
<p>This means that if you are an average person you are likely to be paying in 9 years of premiums beyond the lump sum value that you would get back.</p>
<p>However calculating the benefit of these plans isn&#8217;t quite as simple as this - they often provide extra benefits such as extra payouts in the event of dying in an accident or whilst travelling.</p>
<p>An obvious factor to look into is the effects of compound interest when adding the same amount (£6) into a bank savings account every month.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0821/compound-interest-on-monthly-savings.gif" border="0" width="411" height="291" alt="compound interest graph on a monthly saving of £6 at 4%" /></p>
<p>This graph is showing the effect of saving £6 a month based on a modest 4% gross interest rate. I based the calculations to produce this graph on the formula given on <a href="http://www.patrickschneider.com/blog/2008/03/compound-interest-with-an-initial-balance-and-monthly-contributions/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.patrickschneider.com/blog/2008/03/compound-interest-with-an-initial-balance-and-monthly-contributions/');">patrick schneider blog post</a>. The final figure after 40 years matches the figure given by other compound interest monthly savings calculators I&#8217;ve seen on the internet so hopefully the graph is accurate! </p>
<p>Below I&#8217;ve put the compound interest curve on top of the previous graph comparing contributions against the cash lump sum.</p>
<p><img src="http://www.reviewmylife.co.uk/data/2008/0821/combined-graph-compound-interest-vs-axa.gif" border="0" width="418" height="263" alt="compound interest graph on a monthly saving of £6 at 4% compared against AXA Sun Life Plan with £6 per month contribution" /></p>
<p>There are further complications to consider such as the effect of inflation. The real worth of any money your family would get back when using these plans is reduced every year due to inflation. On the other hand the real world cost to you goes down each year as your £6 per month will gradually constitute a smaller percentage of your income.</p>
<p>What are my conclusions? I&#8217;m not giving you any! Any decision on whether to use a financial product should be taken based on your personal financial circumstances and with the help of a trained financial advisor (which I&#8217;m not).</p>
<p>I would say that these are the kind of analyses you should be doing when investigating or comparing any kind of financial product, whether it be a savings account, loan or mortgage. Turning financial information into simple graphs is a very powerful tool that can save you a lot of money!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.reviewmylife.co.uk%2Fblog%2F2008%2F08%2F22%2Fgraphing-the-axa-sun-life-guaranteed-over-50-plan%2F';
  addthis_title  = 'Graphing+the+AXA+Sun+Life+Guaranteed+Over+50+Plan';
  addthis_pub    = 'reviewmylife';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<p></p><div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Posts</span><ul></ul></div><script src="http://feeds.feedburner.com/~s/?i=http://www.reviewmylife.co.uk/blog/2008/08/22/graphing-the-axa-sun-life-guaranteed-over-50-plan/" type="text/javascript" charset="utf-8"></script>
<p><a href="http://feeds.feedburner.com/~a/reviewmylife?a=Yo39W7"><img src="http://feeds.feedburner.com/~a/reviewmylife?i=Yo39W7" border="0"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/reviewmylife?a=439a3K"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=439a3K" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=KOZAyk"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=KOZAyk" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=1MOL0k"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=1MOL0k" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=0kwn7k"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=0kwn7k" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=1tuYJK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=1tuYJK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=tTC9dK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=tTC9dK" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/reviewmylife?a=oChMQK"><img src="http://feeds.feedburner.com/~f/reviewmylife?i=oChMQK" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/reviewmylife/~4/372047460" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.reviewmylife.co.uk/blog/2008/08/22/graphing-the-axa-sun-life-guaranteed-over-50-plan/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.reviewmylife.co.uk/blog/2008/08/22/graphing-the-axa-sun-life-guaranteed-over-50-plan/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 2.137 seconds --><!-- Cached page served by WP-Cache -->
