10 AnswersNew Answer
TouchiHe I'm not sure what the code was before applying the fix by Sayed🇧🇩🇧🇩 ... But I figured I would present an alternative of the code using various C# language features you may not have been aware of. https://code.sololearn.com/cpfBJj3MWNf5/?ref=app
In the name of kindly generous ALLAH Thanks ALLAH in 17line you got a mathematuc phrase with a double(decimal number)so the whole reault calculated as double while your variable type is int !:you can not pass double to int but can int to double so use double type in everywhere from your code or in line 17 calculate the whole result as int such as Convert.toInt32(phrase);
I tried to make all the code in double, nothing came of it, if in line 17 it is calculated to int, then the result will be incorrect, since it will replace 0.2 with 0
TouchiHe I'm not sure if you're simply making a statement or if you're seeking a response from me to provide an explanation. If it's the former, then I'm assuming you're still learning many of the basics and I wish you luck on your continued growth. 😉👌 If it's the latter, it wasn't clear as nothing specific was requested. I'm happy to respond to any questions about specific parts you identify. But, you'll need to point out something specific for me to respond to. Otherwise, I'm not really sure where to begin with a general statement like: "I didn't understand most of the code at all."
Oh, thank you
To be honest, I didn't understand most of the code at all.
David Carroll it was a statement, but in general, if it's not difficult for you, could you describe everything that happens there in the comments to the code?