Hi
As a newbie I'm trying to learn to use methods... and I'm a bit stuck . This is what I'm trying to achieve [I'm expanding an exercise from the internet]:
1. select one of 3 countries from a comboBox [cboCountry] - show selected country in cboCountry
2. enter amount of cash to do calculation on [txtAmount]
3. depending on which country is selected will depend on the FxRate - which will show in the textBox txtFxRate
4. txtSubTotal (taxableAmount) should show figure entered in txtAmount * figure entered in txtFxRate [as passed by the cboCountry]
5. txtCashierFee should show 2% on the subTotal [cashierFee of 2% on the taxableAmount]
6. txtGrandTotal then shows subTotal + cashierFee
These are the two errors I get:
C:\BEGIN2\code\Lesson4x\ForEx\Form1.cs(265): 'displayResult' denotes a 'variable' where a 'method' was expected
C:\BEGIN2\code\Lesson4x\ForEx\Form1.cs(236): The name 'fxRate' does not exist in the class or namespace 'ForEx.Form1'
Many thanks for your help in advance
My code:
{
#region
fxRate = 1.74743;
}
fxRate = 89.4507;
fxRate = 6.55381;
#endregion
txtFxRate.Text = cboCountry.Text.ToString();
txtTaxableAmount.Text = taxableAmount.ToString();
taxableAmount = calculateTaxableAmount(taxableAmount, fxRate);
cashierFee = calculateCashierFee(taxableAmount);
grandTotal = calculateGrandTotal(taxableAmount, cashierFee);
displayResult = displayResult(grandTotal);
MessageBox.Show("grand total = " + String.Format("0.C)", grandTotal));