You are on page 1of 5

1

Programming Fundamentals

Assignment # 1
Foundations of Programming: Core Concepts in Computer Systems and C+
+ Development

Name: Shawaiz Khan


Roll No.: 23101002-22
Program: BSCS
Section: Blue
Submitted To: Dr. Jahanzaib

DECEMBER 4, 2023
2

Question # 1
Explain the fundamental components of a computer system, emphasizing the roles of
input/output devices, the CPU, and memory. Discuss how these components collaborate to
execute computer programs.

Answer # 1

Computer:
A computer device is composed of five
basic components that work together to
facilitate data processing. These components
include the central processing unit (CPU),
memory, storage, input devices, and output
devices. Each of these elements plays a crucial
role in the overall functioning and efficiency of
the computer. By working together, they make
the processing of data easier and more
convenient for users.

Components of Computer:
Components of a computer system are the primary elements which make the functioning
of an electronic device smooth and faster. There are five basic components which include:

1. CPU
2. Input devices
3. Output devices
4. Motherboard
5. Memory

The functions of each component of computer are described below:

CPU (central processing unit):


3

The CPU is the main part of a computer, acting as the brain. It processes information,
makes decisions, executes instructions, performs calculations, and manages data flow. It is
crucial for computer performance. CPUs have become more powerful, allowing faster and more
efficient data processing. In today's digital age, the CPU is essential for driving innovation and
progress in various fields.

Input & Output devices:


The CPU is the main part of a computer, acting as
the brain. It processes information, makes decisions,
executes instructions, performs calculations, and
manages data flow. It is crucial for computer
performance. CPUs have become more powerful,
allowing faster and more efficient data processing. In
today's digital age, the CPU is essential for driving
innovation and progress in various fields.

Memory & Motherboard:


The CPU is the main part of a computer, acting as
the brain. It processes information, makes decisions,
executes instructions, performs calculations, and
manages data flow. It is crucial for computer
performance. CPUs have become more powerful,
allowing faster and more efficient data processing. In
today's digital age, the CPU is essential for driving
innovation and progress in various fields.

To execute Computer Programs:


The computer components, like memory, CPU,
input/output devices, and motherboard, collaborate to execute programs. Each part is essential
for proper function and they all cooperate to process and display data. Understanding their
collaboration is crucial for troubleshooting computer issues.

Question # 2
Explore the components of a C++ development environment, such as the editor, preprocessor,
compiler, linker, loader, and CPU. Explain the role of each component in the process of writing,
compiling, and executing a C++ program. Provide an introduction to the
4

Dev C++ environment.

Answer # 2

A C++ development environment consists of several components that play a crucial role in the
process of writing, compiling, and executing a C++ program. Different important tools are as
follows:

Editor:
The editor is a tool used for writing and editing C++ code. It provides features such as syntax
highlighting, code completion, and debugging tools to help you develop your code.

Preprocessor:
The preprocessor is a program that processes the C++ code before it is passed to the compiler. It
handles directives such as #include and #define, and performs tasks such as including header files and
macro expansion.

Compiler:
The compiler is a program that translates the C++ code into machine code that can be executed by
the CPU. It checks for syntax errors and generates object files from the source code.

Linker:
The linker is a program that takes the object files generated by the compiler and combines them with
any necessary libraries to create an executable program. It resolves external references and generates
the final executable file

Loader:
The loader is a program that is responsible for loading the executable program into memory for
execution. It performs tasks such as memory allocation and linking of dynamic libraries.

CPU:
The CPU (Central Processing Unit) is the hardware component that executes the machine code
generated by the compiler. It interprets the instructions and performs the computations specified in the
C++ program.

Dev C++ Environment:


5

Dev-C++ is a popular integrated development environment (IDE) used for C and C++
programming. It is free and comes with features like a code editor, debugger, project manager,
compiler, and linker. Its cross-platform compatibility and user-friendly interface have made it
the preferred choice for many developers.

Question # 3
Explore Design a flowchart and provide pseudocode for a program that takes a user-input dollar
amount, converts it to its equivalent in rupees using the exchange rate of 280 rupees per dollar,
and then displays the resulting rupees amount.

Answer # 3

To create a program that takes a user-input dollar amount, converts it to its equivalent in
rupees using the exchange rate of 280 rupees per dollar, and then it displays the resulting
amount in rupees, a flowchart and pseudocode can be designed as follows:

Flow Chart:

Start

Input from users in


Dollars

The value is processed and the


amount is converted by the
help of formula: Input * 280

You might also like