Results 1 to 14 of 14

Thread: Logical thinking

  1. #1

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Thumbs up Logical thinking

    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

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Help on Logical thinking

    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

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Logical thinking

    Duplicate threads merged and moved.

  4. #4

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Logical thinking

    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
    Visual Studio.net 2010
    If this post is useful, rate it


  5. #5
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Logical thinking

    Code:
    For count = 1
    A = 6 - 1 = 5
    B = 6 + 5 = 11
    Code:
    For count = 2
    A = 5 - 2 = 3
    B = 11 + 3 = 14
    Code:
    For count = 3
    A = 3 - 3 = 0
    B = 14 + 0 = 14
    So the output is 0 and 14
    Last edited by Paul M; Jul 23rd, 2007 at 03:55 AM.

  6. #6

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Logical thinking

    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,
    Visual Studio.net 2010
    If this post is useful, rate it


  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Logical thinking

    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.



    Now the same is done with coding.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Logical thinking

    thank u robDog,now i realize the use of algorithm, a nice lesson u taught me,
    am expecting more ideas and tricks...
    Visual Studio.net 2010
    If this post is useful, rate it


  9. #9
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Logical thinking

    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 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.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  10. #10

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Logical thinking

    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?
    Visual Studio.net 2010
    If this post is useful, rate it


  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Logical thinking

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Logical thinking

    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.
    My usual boring signature: Nothing

  13. #13
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Logical thinking

    Quote Originally Posted by FunkyDexter
    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...
    Attached Images Attached Images  

  14. #14

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Logical thinking

    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...
    Visual Studio.net 2010
    If this post is useful, rate it


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width