Resolved C# Formel

m1000

New member
Joined
Aug 2, 2021
Messages
1
Programming Experience
Beginner
Hello,
can someone tell me please how to write this in c#:
Für Männer:
KFA(in %) = 86,010*log10[Bauch(in cm) - Hals(in cm)]
- 70,041*log10[Größe(in cm)] + 30,30

Für Frauen:
KFA(in %) = 163,205*log10[Bauch(in cm) + Hüfte(in cm) - Hals(in cm)]
- 97,684*log10(Größe(in cm)) - 104,912

Thank in advance
Lisa :)
 
It seems to me the only stumbling blocks to do the translation are:
  • In C#, the decimal separator is . instead of the German convention of using , for your literal values.
  • To compute the base 10 logarithm, you would need to use Math.Log10().
Beyond those, you should be able to write the code yourself even if you just took the 30 minute C# crash course on learning how to program in C#.
 
What is the actual problem here? Do you not understand the maths you posted or do you not understand C#? If it's the former then that's not really a programming problem so it's not really a question for this site. If it's the latter then it's really up to you to learn the basics for yourself and then ask us about specific issues. It's not really for us to teach you how to code in C# or write your code for you. You need to understand the basics at least, do what you can for yourself and then ask us about only what you can't do. There are additions and subtractions in what you posted so surely you aren't asking us how to do that in C#.
 
About 3 or 4 years ago, there was an online trading site that let users script their own trading strategies using C# as the scripting language. (It didn't require people to learn how to program the traditional way much like the way some people are doing scripting in Unity with C#, or some people are scripting other game engines with LUA or Python.) So for a while there was a rash of this type of questions in DIC where people needed help translating formulas that they dug up from God knows where to drive their automated trades. The OP's post almost has the same feel as questions from way back then.
 

Latest posts

Back
Top Bottom