Question : Problem i want the output as
1.user Input
2.user Input
3.user Input
and so ON
i need number of Guests
I know this one is wrong but how can i do that .
Saad Zahoor wrote:I know this one is wrong but how can i do that .
One recommendation here is to *never* give up on moving forward.
You know it is wrong; so, what is the next step? Can you figure out why is it wrong? Can you figure out what is causing it to be wrong? And of course, what can you change to get it closer to not being wrong?
Saad Zahoor wrote:Campbell Ritchie you told me in one of my post that i should use . . .
I am quite sure I didn't tell you to use the ; in that line. A correctly‑written loop incorporating such code will work. The ; is incorrect in that location.
Read this. You have to tell us the details of the error you are suffering otherwise we can't help.
Saad Zahoor wrote:I have tried every possible way to solve this but in vain .. i give up !
I don't know why you gave up so easily (seriously, 19 minutes is really quick to give up in vain !!). Quite frankly, you were already headed in the right direction by using the for loop that took an index. The index would have been good to use as the counter.
Like I said, think about why it is wrong?, meaning what is missing?, and think about how to get there. Once you break it down to a counter (that was missing), then you can draw the conclusion that the for loop has an index, that also can be used as a counter.
[EDIT: and apologies for stepping on Knute, who answered minutes before me.]
Your Help is really Appreciated . Henry Wong , Knute ! Now it is working as i want .
One thing i don't get about the method .Does Every method has its own local variable ? . Can't we access the same variable in multiple variable except for the class variable . I Want to save this info into the file and but can't access the variable
Saad Zahoor wrote:Does Every method has its own local variable ?
Not sure what you mean here... You are the coder of your application, and hence, you declare the variables. And if you declare local variables, then it will be local variables...
If you want a variable to be accessed at a larger scope, then you need to declare them as such. This is what instance and static variables are for.
Henry
Post by:autobot
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, that will fit in a stocking