Jump to content


Check out our Community Blogs

Splitz

Member Since 22 Mar 2011
Offline Last Active Mar 28 2011 12:27 PM
-----

Posts I've Made

In Topic: C# programming exchange rate

24 March 2011 - 12:09 PM

Hi guys
Hey Noobieless, where you from, I got the same assignment two days ago.
I have different problems, Im stuck on classes and constructors, can someone please send some links or give advice on this.
I have my code but need to put it in the class mentioned above


private void button1_Click(object sender, RoutedEventArgs e)
{
double numb3 = double.Parse(currencyamount.Text);
double x = 0;
double answer2 = convert(numb3, x);
convcurrency.Text = answer2.ToString();
}
private double convert(double numb3, double x)
{
double result = 0;
if (radioButton1.IsChecked.HasValue && radioButton1.IsChecked.Value)
result = radiovalues(numb3, x);
else if (gbp.IsChecked.HasValue && gbp.IsChecked.Value)
result = gbpvalues(numb3, x);
else if (usd.IsChecked.HasValue && usd.IsChecked.Value)
result = usdvalues(numb3, x);
return result;
}
private double gbpvalues(double numb3, double x)
{
x = 0.09; //current exchange rate for GBP
return numb3 * x;
}
private double usdvalues(double numb3, double x)
{
x = 0.14; //current exchange rate for USD
return numb3 * x;
}
private double radiovalues(double numb3, double x)
{
x = double.Parse(convamount.Text);
return numb3 * x; //this is the user defined rate
}



Any help or advice would be appreciated. (O' and I have two months programming knowledge so dont dis my codes, it works)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download