Computer Problem Solving Skills

Computer Problem Solving Skills - JSS Two

TOPIC: Computer Problem Solving Skills

CLASS: JSS Two

Learning how to solve problems using a computer is an essential skill in today's world. When we want a computer to do something specific, like calculate sums or display images, we need to give it very clear instructions. This is where computer programs come in!

Concept of Computer Program and Programming Language

A computer program is essentially a set of step-by-step instructions (also called commands) that tell a computer exactly how to complete a specific task. Think of it like a recipe for a computer – if you follow the steps correctly, you get the desired result!
It can also be defined as a set of instructions that the computer's central processing unit (CPU) executes.

What is Programming?

Programming is the art and science of writing these computer programs. The talented individuals who write computer programs are called programmers. They use special languages to communicate with computers.

Computer Programming Language

A computer programming language is the special language used to write instructions for the computer. It's how programmers "talk" to computers to solve different types of problems. These languages have strict rules for how words are written (syntax) and what each word means (semantic).

Types of Programming Languages

Computer languages can be broadly categorized into three types:

  1. Machine Language
  2. Low-Level Language (Assembly Language)
  3. High-Level Language (HLL)

Machine Language

This was the very first generation of programming languages. A computer can only directly understand one language: machine language. It's made up of just two symbols: 1 and 0, which are commonly called binary digits or bits.

While fundamental, machine language has its disadvantages:

  • It requires the programmer to memorize numeric codes for every instruction and the exact location of data in binary form, which is very difficult!
  • Machine language is machine dependent, meaning a program written for one type of computer might not work on another without significant changes.

Low-Level Language (Assembly Language)

Assembly language uses abbreviated commands (like acronyms) that are easier for humans to understand than pure binary. For example, you'll see words like "ADD" for addition, "SUB" for subtraction, and "LOAD" for loading data. It's still very close to machine language, which is why it's called a low-level language.

Computers can't directly execute assembly language. It needs a special program called an assembler to translate it into machine language.

The main challenges with assembly language include:

  • It is also machine dependent, so programmers still need to know specific numeric codes for each machine.
  • Programs written in assembly language can be slower to execute compared to machine language because of the translation step.

High-Level Language (HLL)

High-level languages were developed to overcome the complexities of machine and assembly languages. These languages allow programs to be written in a way that's much more readable and understandable for humans, often resembling English statements.

A great advantage of high-level languages is that they can often run on different types of machines, as long as the appropriate translators (like compilers or interpreters) are installed.

Some popular examples of high-level languages you might hear about include:

  • BASIC: Beginners All-purpose Symbolic Instruction Code
  • COBOL: COmmon Business Oriented Language
  • FORTRAN: FORmula TRANslation
  • ADA: Named after Ada Augusta
  • APL: A Programming Language
  • RPG: Report Program Generator
  • PL/1: Programming Language 1
  • dBASE: Data Base
  • LISP: List Processor
  • PASCAL
  • JAVA
  • C++

Programming Tools and Techniques

To write good computer programs, programmers use various tools and techniques. Two of the most important are algorithms and flowcharts.

Algorithm

An algorithm is a detailed, step-by-step outline of what needs to be done to solve a problem. A good algorithm should be:

  • Clear: Easy to understand.
  • Effective: It actually solves the problem.
  • Unambiguous: There's only one way to interpret each step.

Additionally, an algorithm should always take some input and produce a desired output.

Example 1: Write an algorithm to compute the area and circumference of a circle given the diameter 'd'. Use the formulas A=πr2 and C = 2πr

Solution:

  • Step 1: Start
  • Step 2: Get the diameter 'd' as input
  • Step 3: Compute the radiusr=(d2)
  • Step 4: Compute the area A = πr2
  • Step 5: Compute the circumference C = 2πr
  • Step 6: Display (output) the calculated values of A and C
  • Step 7: Stop

Example 2: Write an algorithm that describes how to wash dishes.

Solution:

  • Step 1: Start
  • Step 2: Scrape food off dishes.
  • Step 3: Wash the dishes with soap and water.
  • Step 4: Rinse the dishes thoroughly.
  • Step 5: Dry the dishes.
  • Step 6: Stop

Example 3: Preparing Pounded Yam (A Real-World Example!)

Here's an algorithm for a common task in Nigeria: preparing pounded yam!

Solution:

  1. Start
  2. Get the yams.
  3. Peel the yams and slice them into smaller pieces.
  4. Rinse the yam and put them into a clean pot.
  5. Add some water.
  6. Boil the yam for 35 to 40 minutes.
  7. Pound the yam until there are no lumps.
  8. Dish out the pounded yam.
  9. Serve it with an appropriate soup.
  10. Stop

Flowchart

A flowchart is a visual or graphical representation of the steps involved in solving a given problem. It uses special symbols to show the sequence of operations.

Here are some standard symbols used in drawing a program flowchart:

Example 1: Flowchart for Calculating Area and Circumference of a Circle

This flowchart visually represents the algorithm we discussed earlier for computing the area and circumference of a circle given the diameter (d).

Comments

Post a Comment

Popular posts from this blog

90 Objective Examination Questions in Major Subjects

Complete Computer Studies/ICT Curriculum for JSS 1 to SSS 3

JSS 3 Objective Questions and Answers in Computer studies