Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

developing logic thinking

Status
Not open for further replies.

Minora

Technical User
Dec 30, 2000
17
ZA
Hi

Are there any websites on the web that test logic thinking or and help develop or enhance it? I am especially interested in the kind of logic test that will be given to somebody that applies for a entry level programming job. What would be a good way to develop logic thinking that will help with programming.

Thanks
Minora
 
One way to do it is to start examining everyday tasks in minute detail. Sad I know, but sometimes it helps to get into the habit of breaking a task into sub tasks and sub sub tasks etc etc.
Most of it just comes with programming practice and making lots of mistakes and it is definitely something I had to learn, rather than having any innate abilities. Static Apnea - snorkelling in a swimming pool without the snorkel?
 
Get a college level Logic textbook. It is a standard course in any Philosophy Department.

Stephen J Spiro
 
Thank you both for answering

pipk I assume you mean like when somebody says hit the lights it means. When the lights are one turn them off. or When the lights are off turn them on.

Stephen do you know of such a book that I can buy through amazon etc. I am studying COBOL through distance learning.
ISBN number etc.

Thanks again

 
Hi Minora,

If you're trying to learn how to program you should learn the most frequently
used constructs. Two of them, used in a batch environment, are control breaks
and file match. Check the FAQ here for a discussion of control breaks; if you
want an example of a file match, I can provide it, just list your e-address.

Regards, Jack.
 
I recently took a course in Rule Based Software Design. This is an excellent course. The object is to formulate all of the possible logical occurrances in a program and produce a set of rules to cover every possible occurrance and then write a program for the rules. Not many places teach a course like this.
This is a different approach to programming than just structured logic in a COBOL program. The course actually used Java as a programming language to teach the course.
Another basic course is a course on algorithms. Such a course would require production of pseudo code and cover basic computer concepts to help a person to understand how a computer does what it does. We covered basic machine language, a simple version of Assembly, and Pascal. This course makes you use a thought process so you are thinking about how the computer logically works rather than how people think. Programming is a combination of various steps. You learn how to combine the steps to perform loops and use switches.

As others have stated, a book in structured programming logic is nice as a reference. However unless you actually have to write the programs it does one no good. People learn logic by applying it.

When they ask you how you would solve problems always say something like "I would look for similar programs and just copy what has been done before, adding my own logic to complete the job. There is no reason to spend days reinventing the wheel." A lot of programs are written using copy and paste form the existing programs and/or copy books that already do what you want.

Of course then there is the System Analysis and Design Approach. That involves a more broad approach and is much more structured requiring an analysis of whether the project is cost effective, by looking at the benefit and weighing it against the cost before proceeding with the project. A good programmer has to know when to question the validity of a proposed project or programming assignment and then be able to back up his/her reasoning process with facts. Sometimes the solution they want is worse than the problem.

 
One of the most helpful tasks involved learning Boolean Algebra. Boolean (binary) Algebra involves many of the logic processes which most programmers need to know, and Boolean logic is used rather frequently in program applications, no matter what the programming language.

You can either take a course or get a book on Boolean Algebra at a local community college; it's not that hard of a course. I think that some of the elementary logic courses teach Boolean Algebra.

Or else, the best thing to do is sign up for a basic course in a programming language. Basic and Visual Basic are a lot of fun and not that hard.

Nina Too
 
Thanks Slade a example would be nice

minora@bigfoot.com

What is the best way to develop sequential logic as in looping moving numbers from one "box" to another etc. I suspect the best way is to practice a lot and learn from my mistakes. Correct ?

Thanks for everyone answering.

Regards
Minora
 
Lights on and off maybe a bit simplistic, but how about adding some logic in there for locating the lightswitch!! etc etc
 
Bubble sort algorithm in Java

for (i=0; i<n-1; i++) {
for (j=0; j<n-1-i; j++)
if (a[j+1] < a[j]) { /* compare the two neighbors */
tmp = a[j]; /* swap a[j] and a[j+1] */
a[j] = a[j+1];
a[j+1] = tmp;
}
}

This is in Java but the concept is simple it is for a bubble sort using an array(table). You use one temporary field.

1. When you decide to move an item you put the value of the receiving field in the temporary field.

2. Move the sending field to the receiving field.

3. Then just move the temporary field to the sending field.

This is a standard algorithm; basically it keeps making passes till there is nothing left to sort. The Swap section is what you were talking about. In the example it just moves them up or down one depending on the direction you want to go. One way is to move the largest one to the bottom and another way is to move the smalles one to the top. Bubble sort is very slow for large amounts of data. The swap concept could be used to randomize a set cards or to deal cards at random. All you would have to add is a random number selection process.

Just think of j and i as the sub-script numbers or counters. One for each location of the 2 locations you are testing.
 
Hi Minora,

Just wondering, did you get the code I sent you?

Jack
 
Hi slade

No I did not receive it

Thanks
Minora
 
Hi Minora,

I sent the code @ 3:00 P.M. NY time today. Did you get it?

Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top