<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Der Informatikblog &#187; Exception</title>
	<atom:link href="http://www.informatik-blog.net/tag/exception/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.informatik-blog.net</link>
	<description>Informatik &#38; Co.</description>
	<lastBuildDate>Mon, 28 Jun 2010 19:43:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kalkulation des Zineszins</title>
		<link>http://www.informatik-blog.net/2009/01/21/kalkulation-des-zineszins/</link>
		<comments>http://www.informatik-blog.net/2009/01/21/kalkulation-des-zineszins/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 19:19:10 +0000</pubDate>
		<dc:creator>Emanuel</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[Math.pow]]></category>

		<guid isPermaLink="false">http://www.informatik-blog.net/?p=26</guid>
		<description><![CDATA[

Hier eine nicht von mir entwickelte Methode zur errechnung des Zineszins. Da ich der meinung bin, dass dies eine sehr nützliche und sauber Programmierte Methode ist, möchte ich sie euch nicht vorenthalten. Vielen Dank an das Java CodeBook für diesen Artikel. Folgendes Beispiel demonistriert die Kaltulation des Zineszins:


/*
 * Beispiele erstellt von Emanuel Seibold
 * [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Hier eine nicht von mir entwickelte Methode zur errechnung des Zineszins. Da ich der meinung bin, dass dies eine sehr nützliche und sauber Programmierte Methode ist, möchte ich sie euch nicht vorenthalten. Vielen Dank an das Java CodeBook für diesen Artikel. Folgendes Beispiel demonistriert die Kaltulation des Zineszins:<br />
<span id="more-26"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
 * Beispiele erstellt von Emanuel Seibold
 * Quelle EBooks, Tutorials
 */</span>
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tutorialzahlen</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Kapitalentwicklung bei monatlicher Ratenzahlung und Zinseszins
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">double</span> capitalWithCompoundInterest<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> startCapital, <span style="color: #000066; font-weight: bold;">double</span> installment, <span style="color: #000066; font-weight: bold;">double</span> interest, <span style="color: #000066; font-weight: bold;">int</span> term<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>interest <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0.0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">IllegalArgumentException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Zins darf nicht Null sein&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> interestRate <span style="color: #339933;">=</span> interest <span style="color: #339933;">/</span> <span style="color: #cc66cc;">100.0</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">double</span> accumulationFactor <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">+</span> interestRate<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">double</span> endCapital <span style="color: #339933;">=</span> startCapital <span style="color: #339933;">*</span> <span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span>accumulationFactor, term<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> installment <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span>accumulationFactor, term<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span>accumulationFactor, <span style="color: #cc66cc;">1</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">12.0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span>accumulationFactor, <span style="color: #cc66cc;">1</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">12.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> endCapital<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Berechnung des eingezahlten Kapitals
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">double</span> paidInCapital<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> startCapital, <span style="color: #000066; font-weight: bold;">double</span> installment, <span style="color: #000066; font-weight: bold;">int</span> term<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">double</span> endCapital <span style="color: #339933;">=</span> startCapital<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> n <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> n <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> term<span style="color: #339933;">;</span> <span style="color: #339933;">++</span>n<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            endCapital <span style="color: #339933;">=</span> endCapital <span style="color: #339933;">+</span> <span style="color: #cc66cc;">12</span> <span style="color: #339933;">*</span> installment<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> endCapital<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.informatik-blog.net/2009/01/21/kalkulation-des-zineszins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings in Zahlen umwandeln</title>
		<link>http://www.informatik-blog.net/2009/01/21/strings-in-zahlen-umwandeln/</link>
		<comments>http://www.informatik-blog.net/2009/01/21/strings-in-zahlen-umwandeln/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 17:56:38 +0000</pubDate>
		<dc:creator>Emanuel</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[Integer]]></category>
		<category><![CDATA[parseInt]]></category>

		<guid isPermaLink="false">http://www.informatik-blog.net/?p=22</guid>
		<description><![CDATA[

Jeder kennt es, jeder braucht es. Manchmal sind Integers als String hinterlegt und müssen für verschiedene Mathematischen Operationen in Strings umgewandelt werden. Hier seht ihr wie die Funktion Integer.ParseInt() genutzt wird. Bitte beachten sie auch, dass keine Buchstaben oder Sonderzeichen im String vorkommen dürfen, da ansonsten eine java.lang.NumberFormatException geworfen sind.
Die ausgabe im Beispiel wäre:  [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Jeder kennt es, jeder braucht es. Manchmal sind Integers als String hinterlegt und müssen für verschiedene Mathematischen Operationen in Strings umgewandelt werden. Hier seht ihr wie die Funktion Integer.ParseInt() genutzt wird. Bitte beachten sie auch, dass keine Buchstaben oder Sonderzeichen im String vorkommen dürfen, da ansonsten eine java.lang.NumberFormatException geworfen sind.<br />
Die ausgabe im Beispiel wäre: <span id="more-22"></span> <strong>12345</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tutorialstrings</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author li
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param args the command line arguments
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">String</span> numString <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;12345&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> num <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            num <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>numString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">NumberFormatException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.informatik-blog.net/2009/01/21/strings-in-zahlen-umwandeln/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lottozahlen generieren</title>
		<link>http://www.informatik-blog.net/2009/01/21/lottozahlen-generieren/</link>
		<comments>http://www.informatik-blog.net/2009/01/21/lottozahlen-generieren/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 17:49:37 +0000</pubDate>
		<dc:creator>Emanuel</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[nextInt]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[TreeSet]]></category>

		<guid isPermaLink="false">http://www.informatik-blog.net/?p=17</guid>
		<description><![CDATA[

Oft denkt man sich, dass es wesentlich sinnvoller ist Lottozahlen zu generieren, als sie selbst anzukreuzen. Das ankreuzen kostet nicht nur Zeit, sondern man steht auch oft davor und weiß nicht welche zahl man nehmen soll. Hierfür kann man diese Zahlen am besten per Java generieren. Dies spart nicht nur Zeit, sondern es ist auch [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Oft denkt man sich, dass es wesentlich sinnvoller ist Lottozahlen zu generieren, als sie selbst anzukreuzen. Das ankreuzen kostet nicht nur Zeit, sondern man steht auch oft davor und weiß nicht welche zahl man nehmen soll. Hierfür kann man diese Zahlen am besten per Java generieren. Dies spart nicht nur Zeit, sondern es ist auch Witzig anzusehen, welche zufallsergebnisse raus kommen. Die Ausgabe unterscheidet sich natürlich bei jedem aufruf, könnte aber, wie z.b bei mir folgende sein:<br />
<span id="more-17"></span><br />
<strong>2<br />
6<br />
8<br />
14<br />
24<br />
40</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tutorialstrings</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Random</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.TreeSet</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author li
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param args the command line arguments
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Lottozahlen!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">TreeSet</span> randomNumbers <span style="color: #339933;">=</span> uniqueRandoms<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">49</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> e <span style="color: #339933;">:</span> randomNumbers<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span> <span style="color: #339933;">+</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">TreeSet</span> uniqueRandoms<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> size, <span style="color: #000066; font-weight: bold;">int</span> min, <span style="color: #000066; font-weight: bold;">int</span> max<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">TreeSet</span> numbers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">TreeSet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">Random</span> generator <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> n<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>size <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> max <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">-</span> min<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">IllegalArgumentException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;keine eindeutigen Zahlen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>size <span style="color: #339933;">==</span> max <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">-</span> min<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> min<span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> max<span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                numbers.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>numbers.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> size<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                n <span style="color: #339933;">=</span> min <span style="color: #339933;">+</span> generator.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span>max <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">-</span> min<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                numbers.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> numbers<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.informatik-blog.net/2009/01/21/lottozahlen-generieren/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
