Click to See Complete Forum and Search --> : Logical thinking
vijy
Jul 23rd, 2007, 12:47 AM
Hi all,
Am new to programming, can anybody give me guidelines how to improve the logical thinking.. Right now i learnt all the syntax(c#),now am practising simple examples like sum of n numbers,fibonacci series,,
But me failure to get the logical think behind the code, so pls give me some guidelines.
Dear moderator, i am in confusion where to post this so only i made this post here, if this is not right means.. tell me the right link to post..
Thanks
Paul M
Jul 23rd, 2007, 02:35 AM
This is probably more of a general developer like question ;)
Anyway before moving on and creating large applications, make some simple applications like a calculator or a simple text editor. As for understanding code read some tutorials.
Have a look at this site :)
http://www.functionx.com/csharp/index.htm
Anyway maybe look at examples and try figure things out. Like:
A <- 6
B <- 6
FOR COUNT 1 to 3
A <- A - COUNT
B <- B +A
OUTPUT A,B
That is an example of code in a NS-Diagram that my teacher gives the class often. No IDE to work it out has to be done on paper. Once you get the handle of that it is easy ;)
Output is A = 0 and B = 14
penagate
Jul 23rd, 2007, 03:27 AM
Duplicate threads merged and moved.
vijy
Jul 23rd, 2007, 03:45 AM
Thank u for the tips... tell how the answer will come as A=0,B= 14..
i Worked it and got the ANSWER AS A=3,B=18..
Also give more examples like this,its interesting
Paul M
Jul 23rd, 2007, 03:52 AM
For count = 1
A = 6 - 1 = 5
B = 6 + 5 = 11
For count = 2
A = 5 - 2 = 3
B = 11 + 3 = 14
For count = 3
A = 3 - 3 = 0
B = 14 + 0 = 14
So the output is 0 and 14 :D
vijy
Jul 23rd, 2007, 05:32 AM
Thank u...
i think u know well what mistake i did while solving...
can u give me more examples...or else give me some small samples which will give more work to brain.
send as a PM too..
Am refering the website which u told me to see.. its nice,
RobDog888
Jul 23rd, 2007, 05:38 AM
To think logical you need to break everything down into simple basic steps. Everyone can do programming if they could tap into their logical thinking.
Take any manual task and write the steps to do it in as much detail as you can.
For example, opening/drinking a beer.
1. Think to self, "Do I have any beer in my fridge?
2. If no GoTo store and buy (simplified here because im tired). Once obtained goto step 8
3. If yes then GoTo fridge.
4. Open fridge door by extending out had, grasping handle, and pulling on it until it opend, then stop pulling
5. Use eyes to look around in fridge for subject of desire - beer.
6. Once beer is located, use other hand (as first hand is holding door open) and extend out had to location of beer, grasp on to it, lift and retract towards self.
7. Once beer is obtained use other hand and close door.
8. Return to your place of rest.
9. Use hand and twist off beer top (assums twist off top type).
10. Raise beero to mouth.
11. place beer bottle in nouth comfortably.
12. Tilt beer bottle upward so refreshing fluid inside will pour into ones mouth.
13. Drink beer down in a guzzle of furybecause you are so stressed from programming.
14. return beer bottle back down and close mouth.
15. Repeat steps 9-14 until Beer = Null.
:lol:
Now the same is done with coding.
vijy
Jul 23rd, 2007, 06:21 AM
thank u robDog,now i realize the use of algorithm, a nice lesson u taught me,
am expecting more ideas and tricks...
FunkyDexter
Jul 23rd, 2007, 07:07 AM
Vijy, is Mensa active in India? If so, join (it's nowhere near as hard to get in as members like to think ;)). They'll cheerfully send you a constant stream of logic problems to solve. In fact, you don't really need to be a member, they're happy to send alot stuff out to anyone. Here's a link (http://www.mensa.org.uk/include/qbe/rss_brainteasers.xml) to a site where you can subscribe to their puzzles lists.
edit> Robdog, Could you write me an algorithm for decent wine, please? I'm planning on taking my alcoholism up-market.
vijy
Jul 23rd, 2007, 09:33 AM
Funky, only through solving maths is the way of thinnkin logically?
Let me try....
thank u, yes mensa available..
i will join,
Wat do u meant by decent wine?
Shall i try for this algorithm?
Tell the requirement clearly once again?
RobDog888
Jul 23rd, 2007, 01:22 PM
Try to see what is meant by locically thinking. Its more of a scientific approach to performing some task. Doesnt matter what it is, just try to perform it scientifically not emotionally.
"I am really really thirsty. I want a beer. I think I will get and drink a beer."
Do more granular analysis of the task/problem.
Shaggy Hiker
Jul 23rd, 2007, 03:25 PM
Logical thinking can only get you so far, too. One of the other things you should consider whenever you are designing a program is how you want to interact with the program. For most users, the interface IS the program, and what happens behind the scenes is relatively unimportant. Therefore, spending considerable thought thinking about how you would like to perform a task can really pay off in ease of use and friendliness of the interface, and none of that is necessarily logical. For instance, many people have tried to replace the mouse with various other things, yet mice are still on every desktop (mine's embalmed, but that's another story). Look at the things you do to perform a certain task on the computer, and consider how it could be made better, faster, etc. Good interface is a good start.
And now on the more flippant side: Some tasks don't bear much thinking about. I was once working on a chess program, unitl I realized that the rules to win a King-Rook endgame are unlike the rules that would guide any other decision in the game. Some of that happens in life. Never stop to consider your own tongue, or the very implausibility of it may cause you great harm. Eating is something like a video game for tongues where two great blades are crashing down in a roughly predictable order, and you are dancing around between them trying to synchronize your motion with the blades.
The point being: Not all things bear rational thought. Sometimes you have to take a guess at how something should work, and give it a try. I bit the hell out of my tongue the other day.
szlamany
Jul 23rd, 2007, 03:41 PM
edit> Robdog, Could you write me an algorithm for decent wine, please? I'm planning on taking my alcoholism up-market.No logic needed - it's a simple "see this on the neck and buy the bottle". More of a reflex action...
vijy
Jul 23rd, 2007, 10:42 PM
Thanks a lot to all,to share there views.
I will analysis the problem given by robdog..
i too got some ideas from shaggy.. Analysing the problem is must...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.