Computer Basics | Algorithms and Problem Solving

Computer Basics, Algorithms and Problem Solving

Problem Solving and Computer Science

The main purpose of computer science and programming is to solve problems. Problem solving can be defined as the the process of finding solutions to difficult or complex issues.

In computer science, we use algorithms. An algorithm is a sequence of instructions that is used to find a solution. Problem solving is about understanding the problem at hand and figuring out how to translate the problem into a solution suitable for the computer. 

Implementation and IDEs

Once we understand the problem and devise a plan, we can begin implementing the solution. Implementation involves writing in a language that can be understood by both the computer and the human programmer. Testing is another important part of problem solving that includes verifying that your solution solves the original problem.

There are hundreds of programming languages, each with their pros and cons. Examples of programming languages are Java, Ruby and c++. 

IDEs are Integrated Development Environments. They combine various useful programming tools into one software program. Examples of IDEs are BlueJ, Eclipse and Oracle Developer Studio.

Programming Language Levels and the CPU

There are four programming language levels:

  • machine language
  • assembly language
  • high-level language
  • fourth-generation language

All programs must be translated to a particular CPU's machine language in order to be executed (called compiling).

The CPU is the central processing unit. It is the hardware within a computer that carries out the instructions of a program by performing the basic arithmetical, logical and input/output operations of the system.

The CPU is on a chip called the microprocessor and it continuously follow the fetch-decode-execute cycle. Let's look at those 3 steps. Fetch means the CPU retrieves an instruction from main memory. Decode is when the CPU determines what the instruction is, and Execute is when the CPU carries out the instruction.

The main memory (or RAM) is the primary storage area for programs and data that are still in use. Main memory is volatile, and this means the information that's stored there is maintained only as long as electric power is supplied. Secondary memory devices such as a USB flash drive or hard drive provide long-term storage.

How is the Information Represented?

Information is stored on a computer digitally. It is broken down into pieces and represented as numbers. Every character is stored as a number, as well as digits, spaces and punctuation. This is called binary representation. A single binary digit is a 1 or 0, called a bit. 

Syntax, Semantics and Programming Errors

The syntax rules of a language determine how the vocabulary elements of a computer language can be combined to form statements. 

The semantics of a program statement refers to the purpose and meaning of a statement - what will actually happen when a statement is executed. 

A program that is syntactically correct is not always semantically correct, but remember that a program will always do what you tell it to do, not what you intended to tell it to do. 

A program can have three types of errors:

Compiler errors. Compiler errors are errors that prevent your program from running. They are syntax errors picked up by the compiler. Most compiler errors are caused by mistakes you make when typing code.

Run-time errors. Run-time errors are errors that occur while your program runs. Run-time errors will cause your program to terminate abnormally. An example of this type of error occurs when you try to divide by zero.

Logical errors. Logical errors occur when the program runs but produces incorrect results. Your program did not do what you intended it to do, for example, you might have used an incorrect formula.

Thanks for reading this summary on computer basics, algorithms and other bits of programming information!

New! Comments

Have your say about what you just read! Leave me a comment in the box below.

For You...

Recent Articles

  1. The Path of Least Resistance - Is it the Path for You?

    Aug 12, 22 08:31 PM

    The path of least resistance is a concept that's often used in physics...but it's also used in psychology when talking about human nature. Let's unpack it.

    Read More

  2. 6 Best People Management Courses Online for Team Leads (2022)

    Jul 25, 22 08:12 PM

    Looking for ways to motivate your team and guide them to success? Here are the best people management courses online.

    Read More

  3. What is Meaning-Making? 3 Powerful Lessons From a Holocaust Survivor

    Jul 17, 22 08:23 PM

    What do you see when you look at the world? Let's explore the topic of meaning making and the impact it has, and can potentially have on our lives.

    Read More

If you can see this,  please share this post with the buttons below :)  

Enjoy this page? Please pay it forward. Here's how...

Would you prefer to share this page with others by linking to it?

  1. Click on the HTML link code below.
  2. Copy and paste it, adding a note of your own, into your blog, a Web page, forums, a blog comment, your Facebook account, or anywhere that someone would find this page valuable.