Common to B Tech
Sem – 1ST
Subject Name - Programming for Problem Solving
Paper Code - MUBCS1101
Q 1. What is the difference between hardware and software?
ANS 1. The distinction between hardware and software is fundamental to understanding how
computers function. Here's a clear breakdown:
Hardware:
Definition:
o Hardware refers to the physical components of a computer system. These are the
tangible parts that you can see and touch.
Examples:
o CPU (Central Processing Unit)
o RAM (Random Access Memory)
o Hard drives
o Keyboard
o Mouse
o Monitor
o Motherboard
Characteristics:
o Tangible: It has a physical form.
o Physical components.
o Can be damaged physically.
Software:
Definition:
o Software is a collection of instructions, data, or programs used to operate
computers and execute specific tasks. It's the intangible part of a computer
system.
Examples:
o Operating systems (e.g., Windows, macOS, Linux)
o Application software (e.g., Microsoft Word, web browsers)
o Device drivers
Characteristics:
o Intangible: It exists as digital information.
o Sets of instructions.
o Can be corrupted or have bugs.
Key Differences Summarized:
Tangibility:
o Hardware is tangible (physical).
o Software is intangible (digital).
Function:
o Hardware performs physical actions.
o Software provides instructions for those actions.
Durability:
o Hardware can wear out or be physically damaged.
o Software can be corrupted or become outdated.
Dependency:
o Software requires hardware to function.
o Hardware can exist, but not do useful work, without software
Q 2. What is a flowchart?
ANS 2. A flowchart is a visual representation of a process or algorithm. It uses various
symbols connected by arrows to illustrate the sequence of steps involved. Here's a more detailed
explanation:
Key Characteristics:
Visual Representation:
o Flowcharts translate complex processes into easy-to-understand diagrams.
Step-by-Step Sequence:
o They show the order in which actions occur, making it clear how a process flows.
Decision Points:
o Flowcharts can depict decision points, where the path of the process may diverge
based on certain conditions.
Standardized Symbols:
o They use standardized symbols to represent different types of actions, making
them universally understandable.
Purpose of Flowcharts:
Process Documentation:
o Flowcharts help to document and standardize processes, ensuring consistency.
Problem Solving:
o They can be used to analyze and identify bottlenecks or inefficiencies in a
process.
Algorithm Design:
o In computer programming, flowcharts are used to design and visualize algorithms
before coding.
Communication:
o They facilitate communication by providing a clear and concise visual
representation of a process.
Common Flowchart Symbols:
Oval:
o Represents the start or end of a process.
Rectangle:
o Represents a process or action.
Diamond:
o Represents a decision point.
Arrow:
o Indicates the direction of flow.
Parallelogram:
o Represents input or output.
Q 3. What is a web browser?
ANS 3. A web browser is a software application that allows users to access and view web
pages on the World Wide Web. Here's a more detailed explanation:
Key Functions:
Retrieving Web Pages:
o Web browsers fetch web pages from web servers across the internet.
o They use the Hypertext Transfer Protocol (HTTP) or HTTPS to communicate
with these servers.
Rendering Web Pages:
o Web browsers interpret the HTML, CSS, and JavaScript code that makes up a
web page.
o They then display the content in a visually appealing and user-friendly format.
Navigation:
o Web browsers provide tools for navigating between web pages, such as:
Address bar for entering URLs (web addresses).
Back and forward buttons.
Bookmarks/favorites for saving frequently visited pages.
Hyperlinks that allow you to jump from one page to another.
Security:
o Modern web browsers include security features to protect users from malicious
websites and online threats.
o This includes features like:
Phishing protection.
Malware detection.
Secure connections (HTTPS).
Other Features:
o Many web browsers include additional features, such as:
Tabbed browsing.
Password management.
Extensions/add-ons that add functionality.
Developer tools.
Examples of Web Browsers:
Google Chrome
Mozilla Firefox
Safari
Microsoft Edge
Opera
Q 4. What is the binary number system?
ANS 4. The binary number system is a base-2 number system, meaning it uses only two digits:
0 and 1. This is in contrast to the decimal number system (base-10), which we use in everyday
life and which uses ten digits (0-9).
Here's a breakdown of the binary number system:
Key Concepts:
Base-2:
o It uses only two digits: 0 and 1.
Place Value:
o Each digit in a binary number represents a power of 2, increasing from right to
left.
o The rightmost digit represents 2⁰ (1), the next digit to the left represents 2¹ (2), the
next represents 2² (4), and so on.
Bits:
o Each binary digit (0 or 1) is called a bit (binary digit).
How it Works:
To understand binary, let's compare it to decimal:
Decimal (Base-10):
o In the decimal number 123, the '3' represents 3 x 10⁰ (3), the '2' represents 2 x 10¹
(20), and the '1' represents 1 x 10² (100).
o So, 123 = 100 + 20 + 3.
Binary (Base-2):
o In the binary number 1011, the rightmost '1' represents 1 x 2⁰ (1), the next '1'
represents 1 x 2¹ (2), the '0' represents 0 x 2² (0), and the leftmost '1' represents 1 x
2³ (8).
o So, 1011 = 8 + 0 + 2 + 1 = 11 (in decimal).
Why Binary is Important:
Computers:
o Computers use binary because they operate on electrical signals, which can be in
one of two states: on (1) or off (0).
o This makes binary a natural fit for representing and processing information in
digital systems.
Digital Electronics:
o Binary is fundamental to digital electronics, logic circuits, and data storage.
Q 5. What is a variable in programming?
ANS 5. In programming, a variable is like a container that holds data. It's a named storage
location in the computer's memory that can store and represent different types of values. Here's a
more detailed explanation:
Key Characteristics:
Named Storage:
o Each variable has a unique name (identifier) that allows you to access and
manipulate the data it holds.
Data Storage:
o Variables store different types of data, such as numbers (integers, decimals), text
(strings), or boolean values (true/false).
Value Can Change:
o The value stored in a variable can be changed or updated during the execution of
a program. This is why they are called "variables".
Data Types:
o Variables are associated with specific data types, which determine the kind of
data they can store and the operations that can be performed on them. Common
data types include:
Integers (e.g., 10, -5)
Floating-point numbers (decimals, e.g., 3.14, -2.5)
Strings (text, e.g., "Hello", "Programming")
Booleans (true/false)
Purpose of Variables:
Storing Data:
o Variables allow you to store data that will be used later in a program.
Manipulating Data:
o You can perform operations on the data stored in variables, such as arithmetic
calculations, string concatenation, or logical comparisons.
Making Programs Flexible:
o Variables make programs more flexible by allowing them to work with different
data inputs.