Free currency converter! [Euro & dollar]

Discussion in 'Programming General' started by Yenthe666, Jul 7, 2012.

Free currency converter! [Euro & dollar]
  1. Unread #1 - Jul 7, 2012 at 11:14 AM
  2. Yenthe666
    Joined:
    Apr 10, 2011
    Posts:
    1,013
    Referrals:
    0
    Sythe Gold:
    0

    Yenthe666 Guru
    Banned

    Free currency converter! [Euro & dollar]

    Hey guys!

    I'm studying for my college exam and I just had some fun coding a little currency converter.
    I'm not sure if many people would use it, but hey what the heck.
    Mods: sorry if its in the wrong forum.. :(

    It will calculate from euro to dollar and the other way around.
    For current currencys:
    http://www.google.nl/webhp?hl=nl#hl....,cf.osb&fp=9e112e247a8470d4&biw=1366&bih=651

    Use that currency for the calculation (1 Euro = 1.2273 U.S. dollars) so use 1.2273 in the upper field for currency.

    Screenshots:
    [​IMG]

    Code:
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace H11Oef3
    {
        public partial class FormH11Oef3 : Form
        {
            public FormH11Oef3()
            {
                InitializeComponent();
            }
    
            private void buttonVerwerk_Click(object sender, EventArgs e)
            {
                //declaratie
                double bedrag, bedragHulp;
    
                if (!double.TryParse(textBox1.Text, out bedragHulp) == true)
                {
                    this.Text = "Please only insert a double!";
                    textBox1.Clear();
                    textBox1.Text = "Only decimal numbers!";
                }
    
                if (textBoxEuro.Text == "" && textBoxDollar.Text == "")
                {
                    this.Text = "Please fill in a field.";
                    textBoxDollar.Text = "Fill in one of these fields.";
                    textBoxEuro.Text = "Fill in one of these fields.";
                }
                else
                {
                    if (double.TryParse(textBoxEuro.Text, out bedragHulp) == true)
                    {
                        this.Text = "From Euro to Dollar.";
                        bedrag = ZetOm(Convert.ToDouble(textBoxEuro.Text), 1);
                        textBoxDollar.Text = "-> " + bedrag;
                    }
                    else
                    {
                        if (double.TryParse(textBoxDollar.Text, out bedragHulp) == true)
                        {
                            this.Text = "From Dollar to Euro";
                            bedrag = ZetOm(Convert.ToDouble(textBoxDollar.Text), 2);
                            textBoxEuro.Text = "-> " + bedrag;
                        }
                        else
                        {
                            this.Text = "Fill in one field please.";
                        }
                    }
                }
            }
    
            private void FormH11Oef3_Load(object sender, EventArgs e)
            {
                label1.Text = "Current currency? " + Environment.NewLine + "Example: 1,185 from € to $ ";
                this.Text = "Currency converter.";
                buttonVerwerk.Text = "Calculate!";
                textBox1.Text = "1,185";
                this.Icon = Properties.Resources.favicon;
    
            }
    
            private double ZetOm(double bedrag, int code)
            {
                double resultaat = 0.00;
                double omzetkoers = Convert.ToDouble(textBox1.Text); ; 
               
    
                if (code == 1)
                {
                    resultaat = bedrag * omzetkoers;
                }
                else
                {
                    resultaat = bedrag / omzetkoers;
                }
    
                return resultaat;
    
            }
    
            private void textBox1_Click(object sender, EventArgs e)
            {
                textBox1.Clear();
                
            }
    
            private void textBoxEuro_Click(object sender, EventArgs e)
            {
                textBoxEuro.Clear();
                textBoxDollar.Clear();
            }
    
            private void textBoxDollar_Click(object sender, EventArgs e)
            {
                textBoxDollar.Clear();
                textBoxEuro.Clear();
            }
    
        }
    }
    
    Antivirus scan:
    [​IMG]

    Download link:
    http://www.mediafire.com/?hnqpjm97guu63dq

    If a mod needs the programme for verification or something, just PM me.
     
  3. Unread #2 - Jul 8, 2012 at 12:47 AM
  4. Davidp123
    Joined:
    Nov 3, 2011
    Posts:
    833
    Referrals:
    0
    Sythe Gold:
    0

    Davidp123 Apprentice
    Banned

    Free currency converter! [Euro & dollar]

  5. Unread #3 - Jul 8, 2012 at 4:10 AM
  6. Punkerpunk13
    Joined:
    Jan 24, 2009
    Posts:
    6,600
    Referrals:
    6
    Sythe Gold:
    0

    Punkerpunk13 Onto A New Journey..

    Free currency converter! [Euro & dollar]

    Even though I highly doubt this will ever get used (free on google), but I'm glad you did it regardless. Nice job. :) (atleast it's free for yuan to usd)
     
  7. Unread #4 - Jul 9, 2012 at 9:07 AM
  8. matt_sells
    Joined:
    Nov 28, 2011
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    matt_sells Member

    Free currency converter! [Euro & dollar]

    To make it moderately useful, make it find the current exchange rates of euro to usd.
     
  9. Unread #5 - Jul 9, 2012 at 1:29 PM
  10. Yenthe666
    Joined:
    Apr 10, 2011
    Posts:
    1,013
    Referrals:
    0
    Sythe Gold:
    0

    Yenthe666 Guru
    Banned

    Free currency converter! [Euro & dollar]

    I have absolutely no idea about how to do that, they didn't teach it to us either :D

    Thank you Punker!
     
  11. Unread #6 - Jul 10, 2012 at 4:15 AM
  12. matt_sells
    Joined:
    Nov 28, 2011
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    matt_sells Member

    Free currency converter! [Euro & dollar]

    You could do it many ways, like finding a static url with up to date exchange rates then using regex to parse the page for the info. That's probably the easiest (in my opinion).
     
< Java, J2EE Web application development | Need easy program >

Users viewing this thread
1 guest


 
 
Adblock breaks this site