Question #37804

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

Expert's answer

Answer on Question#37804- Programming, C#

1. 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.

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 CurrencyConverterApplication
{
    public partial class Currency_Converter : Form
    {
        public Currency_Converter()
        {
            InitializeComponent();
        }
        private void rateOfExchange_textBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 8 && (e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar.ToString() != ",")
            {
                e.Handled = true;
                MessageBox.Show("Wrong symbol");
            }
        }
        private void amountOfCash_textBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 8 && (e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar.ToString() != ",")
            {
                e.Handled = true;
                MessageBox.Show("Wrong symbol");
            }
        }
        private void Calculate_button_Click(object sender, EventArgs e)
        {
            double buf = Convert.ToDouble(rateOfExchange_textBox.Text) * Convert.ToDouble(amountOfCash_textBox.Text);
            Result_textBox.Text = buf.ToString();
        }
    }
}

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!

LATEST TUTORIALS
APPROVED BY CLIENTS