Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
3.33/5 (2 votes)
See more:
i have a form which allows the user to enter the value of m, Eb and Q in their respective text boxes. there is a combo box which contains two values QAM AND PSK.

I Want to write a program that when a user clicks the calculate button on the form
it checks for the value in the combo box then it performs the calculation

if value in combobox is QAM then it should use the below formula else

4[1-(1/√m)] * Q[√( (3log_2 m / (m-1)) * Eb)]

else if value in combobox is PSK

2Q [ (√(2log_2 m) * Eb * Sin(π / m) ) ]

please help me out. i have not used any math formula in c# before
Posted
Comments
ZurdoDev 17-Nov-14 10:16am    
Where are you stuck then?

You might start by translating one of the formulas so it uses only .NET operators: [^].

And, examine the functions in the System.Math .NET library to find equivalents to your use of [] and log_2: [^]. If there is no .NET, or System.Math library, equivalent to the use of brackets in the formulas, then you'll have to find an equivalent, write one, or, perhaps, someone here can help.
 
Share this answer
 
Comments
Maciej Los 17-Nov-14 15:58pm    
+5!
I think my answer extends yours ;)
Have a look here: A Calculation Engine for .NET[^]. It is very interesting engine which provides functionality to translate formula's variables to its values.
 
Share this answer
 
Comments
BillWoodruff 17-Nov-14 15:55pm    
+5 thanks for bringing that article to my attention: another CP "crown jewel" with a world-class programmer maintaining/extending the code for years !

You might be interested to see what Jing Lu is doing with ReoGrid and ReoScript: ReoGrid was published on CP about a year ago and is now being developed here:

http://reogrid.net/

ReoScript is a full-blown Turing-equivalent scripting language for .NET with a C# like syntax, that could be used in many other types of .NET applications
Maciej Los 17-Nov-14 15:56pm    
Thank you, Bill ;)
Manas Bhardwaj 18-Nov-14 6:55am    
Yup +5!
Maciej Los 18-Nov-14 7:02am    
Thank you, Manas ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900