Fundamentals of Computer Programming Concepts
Classified in Computers
Written on in English with a size of 4.62 KB
Programming Fundamentals
Programming in computing involves automatic data processing and communication. Computers perform arithmetic and logical operations based on instructions, which collectively form a program.
Programming Languages
A programming language is a character set with a specific syntax used to create instructions that a computer can interpret.
Low-Level Languages
These languages are closest to the computer's understanding (binary code). Their characteristics include using characters closely related to the computer's internal operations (bits).
Machine Language
Machine language is one of the lowest levels. It uses the language of 1s and 0s, and each processor has its own specific machine language.
Assembly Language
Assembly language uses abbreviated words (mnemonics), for example, hexadecimal numbers like SRA 4530, where the instruction comes first, followed by the address.
MP ---> MEMORY ---> ACCUMULATOR
High-Level Languages
High-level languages use characters and symbols that are closest to human understanding. They are generally valid across different microprocessors but require a translator for the microprocessor to understand them.
- Examples: BASIC, COBOL, Fortran, Pascal, Visual Basic, C, C++
Language Translators
A source program is the program written by a programmer.
Assembler
An assembler translates a source program written in assembly language into an executable program.
Source Program ---> Assembler ---> Executable Program
Interpreter
An interpreter translates the source program and processes each instruction line by line, executing it immediately.
Source Program ---> Interpreter ---> Execution (line by line)
Compiler
An editor is used to create the source program. The compiler translates this code into machine code, producing an object program. The linker then combines the object program with necessary routines to create the final executable program.
Source Program (edited) ---> Compiler ---> Object Program ---> Linker ---> Executable Program
Program Development Lifecycle
- Goal Definition: Think in general terms to define the program's idea.
- Design: Create organization charts, flowcharts, and define necessary hardware and software resources.
- Coding: Translate the flowchart or design into the desired programming language using an editor to create the source program.
- Compilation/Translation: Translate the source code into a machine-readable format using a compiler or interpreter.
- Execution: Run the program to test its functionality.
- Debugging: Detect and correct faults and errors within the program.
- Maintenance: Simplify, detect minor faults, or adapt the program to new requirements or environments.
Data in Programming
Data refers to all the information processed by a program.
Constants and Variables
Constants are data elements whose values remain fixed throughout the execution of a program.
Variables are data elements whose values can change during the execution of a program.
Algorithms
An algorithm is a step-by-step description of all actions or operations to be performed by a computer, including the order, sequence, and data description.
Parts of a Program
- Data Entry: Takes data and stores it in memory.
- Algorithm/Process: Processes the data according to defined rules.
- Data Output: Displays or provides the results of the processing.
Flowchart Symbols
Standard symbols are used in flowcharts or organizational charts for program design.
Instructions
Instructions are commands written in a program that tell the computer what actions to perform next.
Types of Instructions
- Declaration/Definition: Defines parts like data types, variables, or constants.
- Assignment: Assigns a value to a variable.
- Input/Read: Reads values into variables from an input source.
- Output/Write: Displays the value or result of a variable to an output destination.
- Jump/Control Flow: Alters the program's execution sequence.