Need help with a little Calculator in C# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Need help with a little Calculator in C#

Hey guys I´m new to Programming and i´m experiencing some issues with a Windows-Console Calculator App that i tried to make. So it kinda works but whenever i try to calculate with something else than '+' i have to move one row or more lower in the Windows-Console. It´s hard to explain but maybe somebody knows what i mean. Below is the Code (includes some german) https://code.sololearn.com/cxlXOLblkPzH/#cs

27th Sep 2018, 2:18 PM
Josh B.
4 Answers
+ 2
@Josh B. I have edited your code and add some comments to explain. https://code.sololearn.com/ckh3RPmPFlo3/?ref=app P.S. Just in case you didn't know, actually you can edit your original post, delete the snippet that was cropped, and paste the code URL in the Description text instead, would've looked better : )
1st Oct 2018, 1:12 PM
Ipang
+ 1
@Ipang thank you so much!! That obviously is a lot better than my version... It helps a lot! But there is one more question I have: Whats the difference in using the Equals Method instead of '==' ?
1st Oct 2018, 2:06 PM
Josh B.
+ 1
@Josh B. You're welcome, glad if it helps. The == operator compares only the object reference rather than the content (the text), as I understand it, == is only reliable for comparing string literals (cmiiw), I can't explain in depth though. In Java apparently, a method by the same name is also used for the purpose, C# copied a lot of stuffs from Java : )
1st Oct 2018, 3:45 PM
Ipang
+ 1
Ah okay. Thanks again ;)
2nd Oct 2018, 7:24 AM
Josh B.