Question #39541

Michael is a software developer in FIT technologies. He wants to add a currency converter in the application for the convenience of international customers. Help Michael in creating the currency converter. [10 Marks
1

Expert's answer

2014-03-17T10:48:28-0400

Answer on Question#39541- Programming, C#

1. What are all the other names for the word "modules" in context with C++ programming?

Solution.


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 WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Translate_button1_Click(object sender, EventArgs e)
        {
            double usd;
            double k;
            double rub;
            usd = Convert.ToDouble(Currency_textBox1.Text);
            k = Convert.ToDouble(Amount_textBox2.Text);
            rub = usd * k;
            Result_textBox3.Text = rub.ToString("C");
        }
        private void Currency_textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar >= '0') && (e.KeyChar <= '9'))
                return;
            if (e.KeyChar == '.')
                e.KeyChar = ',';
            if (e.KeyChar == ',')
            {
                if ((Currency_textBox1.Text.IndexOf(',') != -1) ||
                    (Currency_textBox1.Text.Length == 0))
                {
                    e.Handled = true;
                }
                return;
            }
            if (Char.IsControl(e.KeyChar))
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    if (sender.Equals(Currency_textBox1))
                        Amount_textBox2.Focus();
                    else
                        Translate_button1.Focus();
                }
            }
            e.Handled = true;
        }
        private void Currency_textBox1_TextChanged(object sender, EventArgs e)
        {
            Result_textBox3.Text = "";
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS