By : Sir Ahad CH:01
UINIT#01
CONCEPT OF COMPUTER PROGRAMMING
Q1) What is Computer language?
A) A computer language, also known as a programming language, is a way for people to
communicate with computers. It's like a special set of instructions that humans use to tell a
computer what to do. These instructions are written using words and symbols that both
humans and computers can understand.
In summary, a computer language is a way for humans to communicate their ideas and
instructions to a computer so that it can perform specific tasks or operations.
Q2) What are the Strategies of Problem solving?
A) These are the following problem solving strategies:
1. Define the problem
2. Planning the solution
3. Coding the program
4. Testing the program
5. Documentation the program
1. Define the problem: This is the first step where you figure out what you want to
solve with your computer program. You describe the issue or task you want the
computer to help with. It's like telling the computer, "Hey, I need you to do this
specific thing for me."
2. Planning the solution: Once you understand the problem, you need to come up with
a plan to solve it. Think of this as making a roadmap or a set of instructions for
yourself on how you'll use the computer to solve the problem. It's like planning how
you'll complete a puzzle before you start putting the pieces together.
3. Coding the program: This is where you actually write the instructions in a
programming language that the computer can understand. It's like giving the
computer a recipe to follow. You write down the steps in a way that the computer
can follow to accomplish the task.
4. Testing the program: After you've written your instructions (code), you need to
check if they work correctly. You "test" the program by running it on the computer
and see if it does what you wanted it to do. It's like trying out a new recipe you just
made to make sure it tastes good.
1
By : Sir Ahad CH:01
5. Documenting the program: Documentation means writing down what your program
does and how it works. It's like creating a user manual for your program. This helps
you and others understand how the program functions, in case you need to make
changes or if someone else wants to use it.
Q4) What are the characteristics of a programming language C?
A) Here are some key characteristics of the C programming language explained in easy and
simple terms:
1. Procedural: C is a procedural language, which means you write a series of step-by-
step instructions for the computer to follow. It's like giving the computer a to-do list.
2. Low-Level: C is considered a low-level language because it provides a lot of control
over the computer's hardware. It's like working with the individual parts of a
machine, allowing for precise control.
3. Efficient: C programs tend to run quickly and use memory efficiently. It's like having
a well-organized toolbox that lets you do tasks efficiently.
4. Portable: C programs can run on different types of computers with minimal changes.
It's like having a universal language that can be understood by various devices.
5. Simple Syntax: C has a relatively straightforward syntax, making it easier for
programmers to read and write code. It's like using clear and simple instructions in a
manual.
6. Extensible: You can add your functions and libraries to C, making it highly
customizable. It's like building with LEGO bricks, where you can create your unique
structures.
7. Widely Used: C is one of the most widely used programming languages in the world.
It's like a common language spoken by many programmers.
8. Close to Hardware: C allows direct memory manipulation and hardware access,
making it useful for system-level programming. It's like having the keys to the
machine's inner workings.
9. Large Standard Library: C comes with a large set of built-in functions and tools,
making many tasks easier. It's like having a comprehensive toolset in your workshop.
2
By : Sir Ahad CH:01
Q5) Define the generation in programming language:
1. A) 1st Generation (1GL - Machine Language): This is the lowest-level language. It
consists of binary code that the computer's central processing unit (CPU) can directly
understand. It's like speaking to a computer in its own secret code language of 0s
and 1s.
2. 2nd Generation (2GL - Assembly Language): Assembly language is a bit easier for
humans to understand compared to machine language. It uses short, symbolic
names for operations and memory locations. It's like using simple, specific words
instead of pure binary, but it's still quite technical.
3. 3rd Generation (3GL - High-Level Language): These languages are much easier for
humans to use. They use words and symbols that are more like everyday language.
Examples include languages like C, Python, and Java. It's like writing instructions for a
computer in a language that's closer to English.
4. 4th Generation (4GL - Domain-Specific Language): These are even higher-level
languages designed for specific purposes, like database management or data
analysis. They require less coding and are more focused on solving particular
problems efficiently. It's like having a special language just for one specific task.
5. 5th Generation (5GL - Natural Language Processing): These are the most advanced
languages. They aim to understand and respond to human language in a very natural
way. They're still emerging and are focused on making computers understand and
interact with us like humans do. It's like having a conversation with a computer
almost as if you were talking to a person.
Q6) What are errors in programming language?
A) There are three common types of errors in programming:
1. Syntax Errors: These are like grammar mistakes. You've used the programming
language incorrectly, like forgetting a punctuation mark or misspelling a word. It's
like using the wrong word in a sentence, and it doesn't make sense.
2. Runtime Errors: These happen when your program is running, and something
unexpected occurs. It's like trying to bake a cake, and you realize you're out of flour
while you're in the middle of baking.
3. Logic Errors: These are the trickiest. Your program runs, but it doesn't do what you
actually want it to do. It's like giving someone directions to the store, but you
accidentally send them to the wrong store.
Q7) What are language translator in programming and its types?
3
By : Sir Ahad CH:01
Language Translators:
Language translators in programming are tools that help computer programs written in one
programming language understand and run in another programming language. They bridge
the gap between the human-readable code written by programmers and the machine code
that a computer can execute.
There are three main types of language translators:
1. Compiler: A compiler takes the entire program written by the programmer and
translates it into machine code all at once. It checks the whole program for errors
before creating an executable file that can run independently. It's like translating an
entire book from one language to another before you read it.
2. Interpreter: An interpreter, on the other hand, translates the code line by line as it's
being executed. If there's an error, it stops and reports it immediately. It's like having
a live translator who translates your speech as you speak, and if you say something
wrong, they correct you right away.
3. Assembler: Assemblers are used for lower-level programming languages like
assembly language. They translate assembly code directly into machine code. It's like
translating a simplified, more machine-like language into the actual language that
the computer understands.
Q8) Define Object Oriented Programming:
A) Object Oriented Programming:
Object-Oriented Programming is a way to write code that's organized around these objects,
which represent things in the real world, and you can use classes to create and manage
these objects. It helps make your code more structured, reusable, and easier to understand
and maintain.
Q9) What do you mean by visual programming? explain it.
A) Visual Programming
Visual programming is a way of creating computer programs using pictures, diagrams, and
symbols instead of just writing lines of text like in traditional programming. It's like making a
flowchart or drawing to show how a program should work. This makes it easier for people,
especially beginners, to understand and create software because they can see and
manipulate the program's structure visually. Instead of typing out code, you can drag and
drop blocks or use visual elements to build your program
Q10) Why proper documentation of a software program is necessary?
4
By : Sir Ahad CH:01
A) Proper documentation of a software program is important for a few simple reasons:
1. Understanding: It helps you and others understand how the program works. Just like
a manual for a new gadget, it explains what each part of the program does.
2. Maintenance: If you or someone else needs to change or fix the program later, good
documentation is like a map. It makes it easier to make updates without breaking
things.
3. Collaboration: When more than one person works on a program, documentation
helps them work together. It's like sharing a recipe with clear instructions so that
everyone can cook the same dish.
Q11) What is the difference between compiler and interpreter?
A)
Q12) Explain How and why program Program is tested and debugged?
A) Testing means checking if your program works, while debugging is finding and fixing its
mistakes. We test to ensure it does what we want, and we debug to make it work correctly.
It's like tasting a cake and fixing it if it doesn't taste right.
Q13) What is a program and programming?
5
By : Sir Ahad CH:01
A) Program: A program is like a set of instructions that tells a computer what to do. It's a list of steps
that helps the computer perform tasks, like playing a game, browsing the web, or solving math
problems.
Programming: Programming is the act of creating these sets of instructions
(programs) for a computer. It's like giving commands to make the computer do what
you want, just like telling a robot how to perform a task by writing down the steps.
Q13) What is the difference between Syntax and Logical error?
Q14) What is the difference between Object Oriented Programming and Procedural
prodramming?
Procedural Programming Object-Oriented Programming (OOP)
1. Focus: Emphasizes procedures or 1. Emphasizes objects or classes.
functions.
2. Code is organized around functions 2. Code is organized around classes and
that operate on data. objects.
3. Data is separate from functions. 3. Data and functions are bundled
together into objects.
4. Limited code reusability. 4. Encourages code reusability through
inheritance and polymorphism.
6
By : Sir Ahad CH:01
5. Examples: C, Pascal. 5. Examples: Java, C++, Python.
END