Coding standards were developed because frequently someone else will have to maintain your code, and having the code work will not necessarily make it understandable and maintainable. Using "break"...
The code is doing what you told it to do in this statement:
Console.WriteLine(conlist[con] + volist[vo] + conlist[con] + volist[vo] + conlist[con] + volist[vo]);
since you are only using one index...
Believe it or not, I have seen code that used multiple entry into functions. Back in the days when code space and execution time was very critical, some functions were written with several different...
"Yes, if you really want to avoid multiple returns then this is the way to do it. But it isn't as easy to read as the solution given by BioPhysEngr (with my correction). "
No, you are not in the minority. If you make it a popularity contest, of course you will win.
People like to take the easy way out and don't care about who has to maintain their code later.
If you...
BPE, I have programmed using coding standards that strictly forbade the use of goto, continue and multiple returns from a function. I didn't write the standards, but I agreed with them and followed...
BPE, I share your aversion to goto, but I have a similar aversion to 'continue'. I have never used it, since it is easily avoided.
Assuming your code is correct (I haven't tested it), I have...
You have guess defined as an int, but Console.ReadLine() returns a string. That is the mismatch. That's why I gave you this line:
string guess_str = Console.ReadLine();
Then you can convert it to...
BioPhysEngr, I agree that using "goto" is a bad practice. But why do modern languages, including C#, allow its usage? It is an unnecessary statement so it shouldn't be included in the language.
The operation Double.Parse(txtFat.Text); is failing because the text is invalid.
It would be good if you had used the try{ } catch {} around that operation so you could have a messagebox in the...
"I've never like the idea of having to enumerate the controls to detect whether a radio button was selected"
"you could simply add the index to the radio button's Tag property and that would solve...
Thanks for the further suggestions, foamy & Peter. I now simply set the Tag member to represent the Antenna number for that RadioButton when the RadioButton is created in the Design. This greatly...