It isn't Friday but how about a code quest anyway
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
No homework questions here please!!!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
-
No homework questions here please!!!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
:) Actually, the homework version of the question is trivial, converting a while loop to a do loop or the reverse (ok, I thought it was trivial until I was a T.A. and graded what kids turned in), I think my question is non-trivial enough to be a fun challenge.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Ennis Ray Lynch, Jr. wrote:
do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition?
Maybe I am still trying to wake up, but can't understand a thing. Do not rely on looping on? Loops are not pre-initialized? :~
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
How 'bout almighty
goto
? -
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Note sure if this is counts because it relies on values not being initialized when entering the loop...
//calculates 5*5
int? product;
int? counter;
do
{
int a = 5;
int b = 5;
if (product.HasValue)
Product.Value+=a;
else Product.Value = a;if (counter.HasValue)
counter.Value+=1;
else counter.Value = 1;
}
while (counter < b)3x12=36 2x12=24 1x12=12 0x12=18
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Even after many cups of coffee, I've very slow morning. My head is very stiff, anyways let us see.
Ennis Ray Lynch, Jr. wrote:
do loops that are not pre-initialized
That is not hard, it can be initialized inside the loop?
Ennis Ray Lynch, Jr. wrote:
and do not rely on looping on
I have no idea what you meant? loops that don't need loop? huh?
Ennis Ray Lynch, Jr. wrote:
do not rely on a true in the while condition
huh? then you need the mighty
for(;;)
Yusuf May I help you?
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
Yes, yes of course. (Unless I misunderstand the question.) Although I rarely use
do
loops at all. Here's one I wrote long ago (2003), it could use some work:private static int
exec_many
(
PIEBALD.Data.IDatabaseConnector dbc
)
{
int result = 0 ;string intext = "" ; string prompt = "\\nDBT> " ; string command = "" ; System.Console.WriteLine ( "Enter SQL commands here\\nEnd each command with a semi-colon (;)\\nType \\"exit\\" to stop\\n" ) ; do { System.Console.Write ( prompt ) ; intext = System.Console.ReadLine() ; if ( intext == null ) { if ( command == "" ) { intext = "exit" ; } else { intext = ";" ; } } if ( intext.StartsWith ( "--" ) ) { continue ; } prompt = "...> " ; command += " " + intext ; if ( (intext.Trim()).EndsWith ( ";" ) ) { result += exec\_one ( dbc , command ) ; command = "" ; prompt = "\\nDBT> " ; } } while ( intext.ToUpper() != "EXIT" ) ; System.Console.WriteLine ( "Thank you" ) ; return ( result ) ;
}
-
I want to see do loops that are not pre-initialized and do not rely on looping on and that do not rely on a true in the while condition? Why do I want to see it? Well, do loops are cool but not if you have to have the same line of code twice. Can you author a do loop that is not initialized outside of the block, does actual work, and needs a loop? (Remember, functions and methods like getDate() or DateTime.Now can't be used because they have to be initialized somehwere)
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
A lasso or a noose. Care to provide an example of what you don't want?
Dwayne J. Baldwin