Computer Problem Solving Skills

Computer Ethics

TOPIC: Computer Problem Solving Skills

CLASS: JSS Two

Concept of Computer Program and Programming Language
If you want a computer to solve a given problem, you need a computer program.
A computer program is a sequence of related instructions (commands) that tell the computer how to accomplish a specific task.
A program can also be defined as a set of instructions that is executed by the CPU. Programming
Programming is the act of writing a computer program. Computer programs are written by trained and qualified people called programmers.

Computer Programming Language
A computer programming language is the language used to write instructions (commands) for the computer. Programming language is a means through which a programmer communicates with the computer in solving different categories of problems. It consists of a set of rules governing how the words in the language should be written (syntax) and the meaning associated with each word (semantic).

Types of Programming Language
Computer language falls into three broad categories
1. Machine Language
2. Low-Level Language (Assembly language)
3. High-Level Language (HLL}

Machine Language
This was the first generation programming language. A computer will only understand one language, which is machine language. There are two symbols in machine language; these are 1 and 0 generally called binary digits or bits.
Machine language has many disadvantages
1. It requires the programmer to remember the numeric code of each instruction and the location of each data in binary form.
2. Also, machine language is machine dependent; that is to say that different machines have different language formats.

Low-Level Language (Assembly Language)
Assembly is made of abbreviated commands we can assemble into machine code. Acronyms with words such as add (addition), sub (subtraction) and load (loading) are commonly used. Assembly language is closest to machine language and as a result, is called a low-level language. Assembly language cannot be directly executed by the computer, hence it requires a program called the assembler to convert assembly language to machine language
The major problems associated with assembly language are:
1. It is machine dependent; the programmer has to know the numeric code for each machine
2. It slows to execute as compared to machine language

High Level Language
These are programming languages that allow for the program to be written in forms that are readable to human beings. High-level languages are developed to overcome the limitations of machine and assembly languages. In high-level structure, a program is written in forms that resemble the statement of the given problem in English. High-level language can run on a different machine provided appropriate translators are installed.
Examples of popular high-level language are:
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
PL1: Programming Language 1
dBASE: Data Base
LISP: List Processor
PASCAL
JAVA
C++

Programming tools and Technique
Many tools and techniques aid in writing good computer programs, two of which are algorithms and flowcharts.
Algorithm
This is an outline step needed to solve a problem. Thus an algorithm should be clear, effective, and unambiguous. In addition, an algorithm should have input should produce output.
Solution
Compute the area and circumference of a cycle given the diameter d. Use the formular A= πr^2 and C= 2πr
Solution
Step 1: Start
Step 2: Get the diameter d
Step 3: Compute r=(d/2)
Step 4: Compute A= π*r^2
Step 5: Compute C= 2*π*r
Step 6: Displays the result
Step 7: Stop


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

Flowchart
This is the graphical representation of steps involved in solving a given problem
Some standard symbols used in drawing a program flow chart are:


Example 1:
Produce a flowchart to compute the area and circumference of a cycle given the diameter d. Use the formular A= πr^2 and C= 2πr
Solution

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 One Objective Questions in Computer Studies/Information Technology