Site icon Gyanodhan

बिहार बोर्ड के सभी विद्यार्थियों को क्लास ग्यारहवीं का कंप्यूटर प्रैक्टिकल फाइल इस तरह से बनाना है | BSEB Computer Science Class 11 Practical – 30 Marks

1. Programming in C++ – 15 Marks

Note: This exam will be conducted through question paper. (ये परीक्षा क्वेश्चन पेपर के माध्यम से होगा)

2. PROJECT WORK – 5 MARKS (Write on any one Project-किसी एक पर प्रोजेक्ट लिखें)

Project Work-1: Work on Computer Fundamentals

Title: Understanding Computer Fundamentals and Their Applications


Introduction

A computer is an electronic device that processes data and performs calculations at high speed. It plays a crucial role in various fields such as education, business, healthcare, and communication. This project explores the fundamental concepts of computers, including their history, components, types, and applications.


Objectives


History and Evolution of Computers

Computers have evolved over time from simple mechanical devices to powerful digital machines.

Generations of Computers:

1️⃣ First Generation (1940-1956) – Used vacuum tubes (e.g., ENIAC, UNIVAC).
2️⃣ Second Generation (1956-1963) – Used transistors, making computers smaller and faster.
3️⃣ Third Generation (1964-1971) – Used integrated circuits (ICs) for more efficiency.
4️⃣ Fourth Generation (1971-Present) – Uses microprocessors (e.g., Intel processors).
5️⃣ Fifth Generation (Future) – Focuses on AI, quantum computing, and nanotechnology.


Basic Components of a Computer

A computer consists of hardware and software components that work together to perform tasks.

1. Hardware Components:

🔹 Input Devices – Keyboard, Mouse, Scanner, Microphone.
🔹 Processing Unit (CPU) – The brain of the computer that executes instructions.
🔹 Memory & Storage

2. Software Components:

🔹 System Software – Operating Systems (Windows, macOS, Linux).
🔹 Application Software – Word Processors, Web Browsers, Media Players.
🔹 Programming Software – Used to write programs (C++, Java, Python).


Types of Computers

1️⃣ Supercomputers – Extremely powerful, used for scientific research (e.g., IBM Summit).
2️⃣ Mainframe Computers – Used by large organizations for data processing.
3️⃣ Personal Computers (PCs) – Used at home and offices (e.g., Laptops, Desktops).
4️⃣ Embedded Computers – Built into other devices (e.g., Smart TVs, Cars, ATMs).


Advantages of Computers

High Speed & Efficiency – Performs calculations in milliseconds.
Automation – Reduces human effort in repetitive tasks.
Communication & Connectivity – Enables instant communication via email, social media.
Data Storage & Security – Stores and secures large amounts of data.


Disadvantages of Computers

Cybersecurity Risks – Vulnerable to hacking, viruses, and data theft.
Dependency & Addiction – Overuse can lead to health and psychological issues.
High Cost & Maintenance – Advanced computers can be expensive to purchase and maintain.
Job Displacement – Automation may replace certain human jobs.


Example: Using a Computer for Data Processing

Objective:

To demonstrate how a computer processes data using a simple C++ program.

Code:

#include <iostream>
using namespace std;

int main() {
    int num1, num2, sum;
    
    // Taking input from the user
    cout << "Enter two numbers: ";
    cin >> num1 >> num2;

    // Processing data (addition)
    sum = num1 + num2;

    // Output the result
    cout << "The sum is: " << sum << endl;
    
    return 0;
}

Explanation:

Sample Output:

Enter two numbers: 5 10  
The sum is: 15  

Applications of Computers

💻 Education – Online learning platforms, digital libraries.
💰 Banking & Finance – ATMs, online transactions, stock market analysis.
🛒 E-Commerce – Online shopping websites like Amazon, Flipkart.
🎮 Entertainment – Video streaming, gaming, music production.
🏥 Healthcare – Medical diagnosis, hospital management systems.


Conclusion

Computers have revolutionized the way we live, work, and communicate. They provide speed, efficiency, and automation in various fields. Understanding computer fundamentals is essential for using technology effectively and securely. As technology advances, computers will continue to play a crucial role in shaping the future.


Bibliography


Project Work-2: on Programming Methodology

Title: Understanding Programming Methodology and Its Applications


Introduction

Programming methodology refers to the set of principles, techniques, and strategies used in designing, writing, testing, and maintaining software applications. It ensures that programs are efficient, reliable, and maintainable. This project explores different programming methodologies, their importance, and a practical example using C++.


Objectives


What is Programming Methodology?

Programming methodology is the systematic approach to software development. It involves:
✔ Writing structured and well-organized code.
Following best practices for debugging and testing.
✔ Choosing the right programming paradigm based on the project.


Types of Programming Methodologies

1. Procedural Programming

Example: A function for calculating the sum of two numbers.

#include <iostream>
using namespace std;

int add(int a, int b) {
    return a + b;
}

int main() {
    cout << "Sum: " << add(5, 10) << endl;
    return 0;
}

2. Object-Oriented Programming (OOP)

Example: A class representing a student.

#include <iostream>
using namespace std;

class Student {
public:
    string name;
    int age;

    void display() {
        cout << "Student Name: " << name << ", Age: " << age << endl;
    }
};

int main() {
    Student s1;
    s1.name = "Alice";
    s1.age = 20;
    s1.display();
    return 0;
}

3. Functional Programming

Example: A function in C++ that mimics functional programming using recursion.

#include <iostream>
using namespace std;

int factorial(int n) {
    return (n <= 1) ? 1 : n * factorial(n - 1);
}

int main() {
    cout << "Factorial of 5: " << factorial(5) << endl;
    return 0;
}

4. Event-Driven Programming

Example: A simple event-driven C++ program using a key press event.

#include <iostream>
#include <conio.h>  // For _getch() function
using namespace std;

int main() {
    cout << "Press any key to continue...";
    char key = _getch();
    cout << "\nYou pressed: " << key << endl;
    return 0;
}

Key Principles of Good Programming Methodology

Modularity – Breaking code into reusable functions and modules.
Readability – Writing clear, well-commented code.
Error Handling – Managing exceptions and errors effectively.
Testing & Debugging – Ensuring code works correctly before deployment.
Code Optimization – Writing efficient algorithms to reduce memory and execution time.


Advantages of Using a Programming Methodology

Improves Code Maintainability – Easier to understand and modify.
Enhances Efficiency – Reduces bugs and improves performance.
Increases Collaboration – Team members can work together on structured code.
Ensures Scalability – Supports the development of large applications.


Example: Implementing a Structured Programming Approach in C++

Objective:

To develop a C++ program following a structured methodology for student management.

Code:

#include <iostream>
using namespace std;

// Define a class for Student
class Student {
public:
    string name;
    int rollNo;
    float marks;

    // Function to input student details
    void input() {
        cout << "Enter Name: ";
        cin >> name;
        cout << "Enter Roll Number: ";
        cin >> rollNo;
        cout << "Enter Marks: ";
        cin >> marks;
    }

    // Function to display student details
    void display() {
        cout << "\nStudent Details:\n";
        cout << "Name: " << name << "\nRoll Number: " << rollNo << "\nMarks: " << marks << endl;
    }
};

int main() {
    Student s1;
    
    // Taking input and displaying student details
    s1.input();
    s1.display();

    return 0;
}

Explanation:

Sample Output:

Enter Name: John  
Enter Roll Number: 101  
Enter Marks: 85.5  

Student Details:
Name: John  
Roll Number: 101  
Marks: 85.5  

Applications of Programming Methodology

💻 Software Development – Ensures structured coding for large applications.
🎮 Game Development – Uses event-driven and object-oriented programming for interactive games.
🌐 Web Development – Uses functional and event-driven programming in JavaScript frameworks.
📊 Data Science & AI – Uses modular programming for machine learning models.


Conclusion

Programming methodology is essential for writing efficient, maintainable, and scalable code. By following structured approaches like procedural, object-oriented, and event-driven programming, developers can create high-quality software. Understanding different methodologies helps in selecting the best approach for a given project.


Bibliography


Project Work-3: on Introduction to Programming in C++

Title: Understanding the Basics of C++ Programming


Introduction

C++ is a powerful, high-performance programming language used in system software, game development, real-time simulations, and more. Developed by Bjarne Stroustrup in 1979, C++ extends the C programming language by adding Object-Oriented Programming (OOP) features.

This project explores the basics of C++ programming, including its features, structure, syntax, and a practical example.


Objectives


What is C++?

C++ is a general-purpose, object-oriented programming language that allows developers to write efficient and modular code. It is widely used for:
Software development (operating systems, applications).
Game development (Unreal Engine).
Embedded systems and IoT (Arduino, microcontrollers).
Competitive programming (fast execution and memory efficiency).


Features of C++

Object-Oriented – Supports classes, objects, inheritance, and polymorphism.
High-Performance – Faster than Java and Python due to compiled execution.
Multi-Paradigm – Supports procedural, object-oriented, and generic programming.
Memory Control – Allows manual memory management using pointers.
Portable – Code can be compiled and executed across different platforms.


Basic Structure of a C++ Program

A C++ program follows a standard structure:

#include <iostream>  // Header file for input/output
using namespace std; // Standard namespace

int main() {  // Main function
    cout << "Hello, C++!" << endl;  // Output statement
    return 0;  // Return statement
}

Explanation:

🔹 #include <iostream> – Includes the input-output library.
🔹 using namespace std; – Allows using standard C++ functions without std::.
🔹 int main() – The main function, where program execution starts.
🔹 cout << "Hello, C++!"; – Prints text to the screen.
🔹 return 0; – Indicates that the program executed successfully.


Basic Syntax and Concepts

1. Variables and Data Types

C++ supports different data types:

int age = 25;       // Integer
float price = 99.99; // Floating point
char grade = 'A';    // Character
string name = "John"; // String
bool isPassed = true; // Boolean

2. Input and Output (cin, cout)

User input is taken using cin, and output is displayed using cout:

#include <iostream>
using namespace std;

int main() {
    string name;
    cout << "Enter your name: ";
    cin >> name;
    cout << "Hello, " << name << "!" << endl;
    return 0;
}

Example Output:

Enter your name: Alice  
Hello, Alice!  

3. Conditional Statements (if-else)

Decision-making in C++ is done using if-else:

int age;
cout << "Enter age: ";
cin >> age;

if (age >= 18) {
    cout << "You are an adult.";
} else {
    cout << "You are a minor.";
}

4. Loops (for, while, do-while)

Loops are used to repeat a block of code multiple times.

For Loop Example:

for (int i = 1; i <= 5; i++) {
    cout << i << " ";
}

Output: 1 2 3 4 5


5. Functions in C++

A function is a block of code that performs a specific task.

Example: Function to add two numbers.

int add(int a, int b) {
    return a + b;
}

6. Object-Oriented Programming (OOP)

C++ supports classes and objects for modular and reusable code.

class Student {
public:
    string name;
    int age;

    void display() {
        cout << "Name: " << name << ", Age: " << age << endl;
    }
};

Example Program: Simple Calculator in C++

Objective:

To implement a basic calculator using user input and conditional statements.

Code:

#include <iostream>
using namespace std;

int main() {
    char operation;
    double num1, num2;

    // Asking user for input
    cout << "Enter operator (+, -, *, /): ";
    cin >> operation;

    cout << "Enter two numbers: ";
    cin >> num1 >> num2;

    // Performing the chosen operation
    switch (operation) {
        case '+':
            cout << "Result: " << num1 + num2 << endl;
            break;
        case '-':
            cout << "Result: " << num1 - num2 << endl;
            break;
        case '*':
            cout << "Result: " << num1 * num2 << endl;
            break;
        case '/':
            if (num2 != 0)
                cout << "Result: " << num1 / num2 << endl;
            else
                cout << "Error! Division by zero." << endl;
            break;
        default:
            cout << "Invalid operator!" << endl;
    }

    return 0;
}

Explanation:

Sample Output:

Enter operator (+, -, *, /): *  
Enter two numbers: 5 6  
Result: 30  

Advantages of C++

Fast and Efficient – Compiled language, faster execution.
Object-Oriented – Supports encapsulation, inheritance, and polymorphism.
Memory Management – Supports manual dynamic memory allocation.
Portable & Scalable – Runs on multiple platforms.


Applications of C++

💻 System Software – Operating Systems (Windows, Linux).
🎮 Game Development – Unreal Engine, Unity.
📊 Finance & Trading Systems – High-frequency trading applications.
🚀 Embedded Systems – Robotics, IoT devices.


Conclusion

C++ is a versatile, high-performance programming language used across various domains. By understanding basic syntax, control structures, and OOP concepts, beginners can start building efficient and scalable programs. With its speed, memory control, and multi-paradigm approach, C++ remains a crucial language in software development, gaming, and real-time systems.


Bibliography


Project Work-4: on System Software Tools

Title: Understanding System Software Tools and Their Applications


Introduction

System software tools are essential programs that manage hardware resources and provide a platform for application software to run. These tools include operating systems, device drivers, utility software, and system management tools. This project explores the types, functions, advantages, and examples of system software tools, along with a real-world application example.


Objectives


What are System Software Tools?

System software tools are programs that help in managing computer hardware and software resources. They act as a bridge between the hardware and user applications.

Key Functions:

Hardware Management – Controls CPU, memory, and storage devices.
Process Management – Handles multitasking and scheduling.
Security & Performance Optimization – Ensures safe and efficient system operation.
User Interface Management – Provides graphical or command-line interfaces.


Types of System Software Tools

1. Operating Systems (OS)

An Operating System is the most essential system software that manages hardware and software interactions.
Examples: Windows, macOS, Linux, Unix.

2. Device Drivers

Device drivers help the operating system communicate with hardware components like printers, keyboards, and graphics cards.
Examples: Printer drivers, Graphics card drivers (NVIDIA, AMD).

3. Utility Software

Utilities help in system maintenance, security, and performance optimization.
Examples:

4. System Monitoring & Performance Tools

These tools help in analyzing and optimizing system performance.
Examples:


Advantages of System Software Tools

Efficient System Management – Controls hardware and optimizes system performance.
Security & Protection – Defends against viruses, malware, and unauthorized access.
Automation & Maintenance – Performs automatic updates, backups, and system checks.
Improved User Experience – Enhances system usability through interfaces and utilities.


Limitations of System Software Tools

Resource Consumption – Some tools consume high CPU and memory, slowing down the system.
Compatibility Issues – Some software tools may not work on all systems.
Security Vulnerabilities – System software can be a target for cyberattacks if not updated.
User Complexity – Some advanced tools require technical knowledge to use.


Example: Using a System Monitoring Tool (Task Manager in Windows)

Objective:

To analyze and monitor system performance using Task Manager in Windows.

Steps:

1️⃣ Press Ctrl + Shift + Esc to open Task Manager.
2️⃣ Click on the “Processes” tab to see running applications and background processes.
3️⃣ Click on the “Performance” tab to monitor CPU, Memory, and Disk usage.
4️⃣ Click on “Startup” to manage programs that start with Windows.
5️⃣ End a non-responsive task by selecting it and clicking “End Task”.

Output Example:


Real-World Applications of System Software Tools

📌 Business IT Management – Companies use monitoring tools to track server performance.
📌 Cybersecurity & Data Protection – Antivirus software prevents cyber threats.
📌 Gaming & Graphics Optimization – Graphics drivers enhance gaming performance.
📌 Data Recovery & Backup – Backup tools prevent data loss in case of system failure.


Conclusion

System software tools play a crucial role in managing hardware, security, performance, and user experience. Understanding these tools helps in optimizing system performance and troubleshooting issues effectively. By using Task Manager, Device Managers, and Utility Software, users can ensure smooth and efficient operation of their computers.


Bibliography


Project Work-5: on Event-Driven Programming in C++

Title: Understanding Event-Driven Programming in C++ with an Example


Introduction

Event-driven programming is a programming paradigm where the flow of execution is determined by user actions or system-generated events. It is widely used in graphical user interfaces (GUIs), gaming, real-time systems, and network applications.

In C++, event-driven programming is commonly implemented using callback functions, event listeners, and GUI frameworks like Qt or SFML. This project explores event-driven programming concepts, working mechanisms, advantages, disadvantages, and a practical example using C++.


Objectives


What is Event-Driven Programming?

Event-driven programming focuses on responding to events such as:
✔ User interactions (mouse clicks, key presses).
✔ System-generated signals (timers, network requests).
✔ Hardware interrupts (sensor data, hardware input).

Example of Events in Software:


How Event-Driven Programming Works?

1️⃣ Event Source: The object that generates an event (e.g., a button click).
2️⃣ Event Listener: Listens for a specific event to occur.
3️⃣ Event Handler: A function that defines what happens when the event is triggered.


Advantages of Event-Driven Programming

User Interactivity – Enables responsive and interactive applications.
Efficiency – Code executes only when an event occurs, reducing CPU usage.
Modularity – Easier to manage separate event handlers.
Flexibility – Supports multi-threaded and real-time applications.


Disadvantages of Event-Driven Programming

Complexity – Managing multiple event listeners can be difficult.
Debugging Issues – Event-driven bugs can be hard to trace.
Higher Memory Usage – Constant event monitoring can increase resource consumption.


Example: Event-Driven Program in C++ (Key Press Event Simulation)

Objective:

To simulate a simple event-driven keyboard interaction in C++ where the program waits for a key press and responds accordingly.

Code:

#include <iostream>
#include <conio.h> // For _getch() function (Windows)
using namespace std;

// Function to handle key press events
void handleKeyPress(char key) {
    switch (key) {
        case 'a': 
            cout << "You pressed 'A' - Moving Left\n";
            break;
        case 'd': 
            cout << "You pressed 'D' - Moving Right\n";
            break;
        case 'w': 
            cout << "You pressed 'W' - Moving Up\n";
            break;
        case 's': 
            cout << "You pressed 'S' - Moving Down\n";
            break;
        case 'q': 
            cout << "You pressed 'Q' - Exiting...\n";
            exit(0);
        default:
            cout << "Invalid key! Use W/A/S/D to move, Q to quit.\n";
    }
}

int main() {
    char key;
    cout << "Event-Driven Key Press Simulation (Press W/A/S/D to move, Q to quit):\n";

    while (true) {
        key = _getch(); // Waits for key press (Windows)
        handleKeyPress(key); // Call event handler function
    }

    return 0;
}

Explanation:


Sample Output:

Event-Driven Key Press Simulation (Press W/A/S/D to move, Q to quit):

You pressed 'W' - Moving Up  
You pressed 'A' - Moving Left  
You pressed 'D' - Moving Right  
You pressed 'S' - Moving Down  
You pressed 'Q' - Exiting...

Real-World Applications of Event-Driven Programming in C++

🚀 GUI Applications – Using Qt, GTK, or SFML for event-based UI development.
🎮 Game Development – Handling player input events in game engines (Unity, Unreal Engine).
🌐 Networking Applications – Managing real-time requests in web servers.
🔧 Embedded Systems – Handling sensor data and device events in IoT.


Conclusion

Event-driven programming is a powerful paradigm that allows programs to respond dynamically to user interactions and system events. In C++, event-driven programming is widely used in GUI applications, gaming, real-time systems, and embedded programming. The example demonstrated a keyboard event handling system, showing how C++ can efficiently handle real-time user input.


Bibliography


Project Work-6: on the Internet

Title: The Internet: Evolution, Functionality, and Impact


Introduction

The Internet is one of the most significant technological advancements of modern times. It has revolutionized communication, commerce, education, and entertainment. This project explores the history, working principles, types of internet services, advantages, disadvantages, security concerns, and its impact on society.


Objectives


History and Evolution of the Internet


How the Internet Works

The Internet functions through a network of interconnected devices that communicate using protocols. Key components include:

  1. Internet Service Providers (ISPs): Companies that provide internet access.
  2. IP Addresses: Unique identifiers for devices on the network.
  3. Protocols:
    • HTTP/HTTPS: Used for web browsing.
    • TCP/IP: Ensures reliable data transmission.
    • DNS (Domain Name System): Translates domain names into IP addresses.
  4. Servers and Clients:
    • Servers store data and websites.
    • Clients (computers, smartphones) request and receive data.

Types of Internet Services

  1. Wired Internet Services:
    • DSL (Digital Subscriber Line)
    • Cable Broadband
    • Fiber Optic Internet
  2. Wireless Internet Services:
    • Wi-Fi
    • Mobile Data (3G, 4G, 5G)
    • Satellite Internet
  3. Internet-Based Services:
    • Web Browsing (Google, Bing)
    • Email Services (Gmail, Outlook)
    • Social Media (Facebook, Instagram, Twitter)
    • Streaming Services (YouTube, Netflix)
    • E-Commerce (Amazon, Flipkart)

Advantages of the Internet

Global Connectivity – Allows communication across the world.
Fast Information Access – Provides instant access to knowledge and news.
Online Education – Platforms like Coursera and Udemy offer learning resources.
E-Commerce & Online Banking – Enables secure online transactions.
Entertainment & Social Networking – Streaming, gaming, and social media engagement.


Disadvantages of the Internet

Cybersecurity Threats – Hacking, phishing, and identity theft.
Privacy Issues – User data tracking and misuse.
Addiction & Distraction – Excessive screen time affects mental health.
Misinformation & Fake News – False information spreads quickly.
Digital Divide – Unequal access to the Internet worldwide.


Security Threats and Protection Measures

🔴 Common Threats:

🟢 Protection Measures:


Impact of the Internet on Society


Example of Internet Usage in Daily Life

Scenario: A student researching for a school project.

Steps Taken Using the Internet:

  1. Uses Google Search to find relevant information.
  2. Watches YouTube tutorials to understand concepts.
  3. Reads Wikipedia articles for in-depth knowledge.
  4. Uses Google Docs to write and share the project with friends.
  5. Submits the project via email or an online portal.

Conclusion

The Internet has transformed the way we live, work, and communicate. While it offers numerous benefits, it also presents challenges such as cyber threats and digital addiction. Understanding the Internet’s workings and practicing safe usage can help individuals maximize its advantages while minimizing risks.


Bibliography


Project- 7: Project Work on Email

Title: The Evolution, Functionality, and Importance of Email Communication

Introduction: Email (Electronic Mail) is one of the most significant communication tools in the digital world. It enables individuals and organizations to exchange messages quickly and efficiently. This project explores the history, working principles, components, advantages, and security concerns related to email communication.

Objectives:

History and Evolution of Email:

How Email Works:

  1. Composition – The sender drafts a message using an email client.
  2. Sending – The email is transferred from the sender’s mail server to the recipient’s mail server via the SMTP (Simple Mail Transfer Protocol).
  3. Receiving – The recipient’s mail server receives the email and stores it in the inbox.
  4. Reading & Replying – The recipient accesses the email through an email client or webmail service using IMAP or POP3 protocols.

Components of an Email:

Types of Email Services:

  1. Web-based Email – Gmail, Yahoo Mail, Outlook.com
  2. Client-based Email – Microsoft Outlook, Thunderbird
  3. Enterprise Email Solutions – Microsoft Exchange, G Suite
  4. Temporary Email Services – Disposable emails for short-term use

Advantages of Email:

Disadvantages of Email:

Security Threats and Protection Measures:

Example of Email Communication: Scenario: A manager wants to inform their team about an upcoming meeting.

Example Email:

Conclusion: Email remains an essential communication tool in personal and professional settings. As technology advances, email continues to evolve with improved security and user-friendly features. Understanding email’s functionality and associated risks helps users communicate efficiently while staying protected online.

Project Work-8: on Computer System Organization

Title: Understanding Computer System Organization and Its Components


Introduction

A computer system is a complex combination of hardware and software that works together to process data and perform tasks efficiently. Computer System Organization refers to the structure and design of a computer, including its components, data processing methods, and interaction between hardware and software.

This project explores the architecture, components, working principles, and applications of computer systems.


Objectives


Basic Architecture of a Computer System

A computer system is based on the Von Neumann Architecture, which includes:

1️⃣ Input Unit – Accepts user input (Keyboard, Mouse, Scanner).
2️⃣ Central Processing Unit (CPU) – Processes instructions and data.
3️⃣ Memory Unit – Stores data and programs (RAM, Cache, Hard Drive).
4️⃣ Output Unit – Displays results (Monitor, Printer, Speakers).
5️⃣ Control Unit – Manages operations of the system.

Diagram of Computer System Organization:

        +-------------------+
        |    Input Unit     |  --->  [Keyboard, Mouse, Scanner]
        +-------------------+
                  |
                  v
        +-------------------+
        |   Central Processing Unit (CPU)  |
        |  - Control Unit (CU)             |
        |  - Arithmetic Logic Unit (ALU)   |
        +-------------------+
                  |
                  v
        +-------------------+
        |   Memory Unit     |  --->  [RAM, ROM, Cache]
        +-------------------+
                  |
                  v
        +-------------------+
        |   Output Unit     |  --->  [Monitor, Printer]
        +-------------------+

Main Components of a Computer System

1. Central Processing Unit (CPU)

The CPU is the brain of the computer, responsible for executing instructions. It consists of:
🔹 Arithmetic Logic Unit (ALU): Performs mathematical and logical operations.
🔹 Control Unit (CU): Directs data flow and manages execution of instructions.
🔹 Registers: Small, fast storage locations for immediate processing.

Example: The CPU processes input data (e.g., pressing a key) and sends output (displaying the letter on the screen).


2. Memory Organization

Memory in a computer is categorized as follows:

🔹 Primary Memory (RAM, ROM) – Fast, volatile storage for active processes.
🔹 Secondary Memory (Hard Drive, SSD) – Permanent storage for files and programs.
🔹 Cache Memory – High-speed memory that stores frequently used data.
🔹 Virtual Memory – Extends RAM using disk space when needed.

Example: Opening a program loads it from the hard drive into RAM for faster execution.


3. Input and Output (I/O) Systems

🔹 Input Devices – Devices like keyboards, mice, and scanners send data to the CPU.
🔹 Output Devices – Monitors and printers display processed data.
🔹 I/O Controllers – Manage communication between CPU and external devices.

Example: A printer receives data from a computer and prints a document.


4. Storage Management

🔹 File System Organization – Manages file storage in NTFS, FAT32, ext4 formats.
🔹 Data Access MethodsSequential (tape storage) vs Random Access (hard drive, RAM).
🔹 Cloud Storage – Data is stored remotely and accessed via the internet.

Example: Saving a document on Google Drive allows access from any device.


Types of Computer Architectures

1. Von Neumann Architecture

✔ Uses a single memory for instructions and data.
✔ Executes instructions sequentially.
✔ Common in general-purpose computers.

2. Harvard Architecture

✔ Separates memory for instructions and data.
✔ Used in microcontrollers, DSPs (Digital Signal Processors).
✔ Faster than Von Neumann for specific tasks.

Example: A calculator uses Harvard Architecture for fast arithmetic processing.


Example: Simple CPU Simulation Program in C++

Objective:

To simulate a basic CPU operation using a program that performs arithmetic operations based on user input.

Code:

#include <iostream>
using namespace std;

int main() {
    int num1, num2, choice;
    
    cout << "Simple CPU Arithmetic Simulator\n";
    cout << "Enter two numbers: ";
    cin >> num1 >> num2;
    
    cout << "Choose operation: 1. Add  2. Subtract  3. Multiply  4. Divide\n";
    cin >> choice;

    switch (choice) {
        case 1:
            cout << "Result: " << num1 + num2 << endl;
            break;
        case 2:
            cout << "Result: " << num1 - num2 << endl;
            break;
        case 3:
            cout << "Result: " << num1 * num2 << endl;
            break;
        case 4:
            if (num2 != 0)
                cout << "Result: " << num1 / num2 << endl;
            else
                cout << "Error! Division by zero.\n";
            break;
        default:
            cout << "Invalid choice!" << endl;
    }
    
    return 0;
}

Sample Output:

Simple CPU Arithmetic Simulator
Enter two numbers: 8 4
Choose operation: 1. Add  2. Subtract  3. Multiply  4. Divide
1
Result: 12

Real-World Applications of Computer System Organization

💻 Operating Systems – Windows, Linux, and macOS manage computer components.
🎮 Game Development – High-performance CPUs process real-time graphics.
📊 Data Centers & Cloud Computing – Large-scale processing and storage of data.
🚀 Artificial Intelligence & Robotics – Uses CPU and GPUs for machine learning models.


Conclusion

Computer system organization is the foundation of modern computing. It defines how hardware, memory, and processing units interact to execute tasks efficiently. Understanding CPU architecture, memory organization, and I/O systems helps in designing faster, more reliable computers for various applications.


Bibliography


3. PRACTICAL FILE – 5 MARKS (Write All 15 Program in Project File-सभी 15 प्रोग्राम को प्रोजेक्ट फ़ाइल में लिखें)

Index :

1️⃣ Hello, World! (✅ Added)
2️⃣ Arithmetic Operations (Variables & Data Types)
3️⃣ If-Else Statement (Decision Making)
4️⃣ For Loop (Iteration)
5️⃣ While Loop (Factorial Calculation)
6️⃣ Do-While Loop (Number Guessing Game)
7️⃣ Functions (Sum of Two Numbers)
8️⃣ Recursion (Fibonacci Series)
9️⃣ Arrays (Sum of Elements in an Array)
🔟 Pointers (Pointer to a Variable)
1️⃣1️⃣ Structures (Student Record System)
1️⃣2️⃣ Classes & Objects (Basic OOP Concept)
1️⃣3️⃣ Constructors & Destructors (Employee Management)
1️⃣4️⃣ File Handling (Read & Write to a File)
1️⃣5️⃣ Templates (Function Template for Addition)

NOTE: All students should note that the program has to be written in pencil on the right side of the practical file in Hindi ruling, whereas the output of the program has to be written in pencil on the left side of the practical file in white page.

नोट: सभी विद्यार्थी ध्यान देंगे प्रोग्राम को पेंसिल से प्रैक्टिकल फाइल के दाएं साइड हिंदी रूलिंग में लिखना है, जबकि प्रोग्राम के आउटपुट को पेंसिल से प्रैक्टिकल फाइल के बाएं साइड वाइट पेज में लिखना है |


Objective:

To print “Hello, World!” on the screen using C++.

Code:

#include <iostream>
using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}

Explanation:

Output:

Hello, World!


Program 2: Arithmetic Operations

Objective:

To perform basic arithmetic operations (addition, subtraction, multiplication, and division) using C++.

Code:

#include <iostream>
using namespace std;

int main() {
    double num1, num2;
    
    // Input two numbers
    cout << "Enter two numbers: ";
    cin >> num1 >> num2;

    // Performing arithmetic operations
    cout << "Addition: " << num1 + num2 << endl;
    cout << "Subtraction: " << num1 - num2 << endl;
    cout << "Multiplication: " << num1 * num2 << endl;
    cout << "Division: " << num1 / num2 << endl;

    return 0;
}

Explanation:

Sample Output:

Enter two numbers: 10 5  
Addition: 15  
Subtraction: 5  
Multiplication: 50  
Division: 2  


Program 3: If-Else Statement (Check Even or Odd)

Objective:

To check whether a number is even or odd using an if-else statement.

Code:

#include <iostream>
using namespace std;

int main() {
    int num;
    
    // Taking input
    cout << "Enter a number: ";
    cin >> num;

    // Checking even or odd
    if (num % 2 == 0) {
        cout << num << " is even." << endl;
    } else {
        cout << num << " is odd." << endl;
    }

    return 0;
}

Explanation:

Sample Output:

Enter a number: 7  
7 is odd.
Enter a number: 10  
10 is even.


Program 4: For Loop (Printing Numbers from 1 to N)

Objective:

To print numbers from 1 to N using a for loop.

Code:

#include <iostream>
using namespace std;

int main() {
    int n;
    
    // Taking input
    cout << "Enter a number: ";
    cin >> n;

    // Printing numbers from 1 to n
    for (int i = 1; i <= n; i++) {
        cout << i << " ";
    }

    cout << endl;
    return 0;
}

Explanation:

Sample Output:

Enter a number: 5  
1 2 3 4 5


Program 5: While Loop (Factorial Calculation)

Objective:

To calculate the factorial of a number using a while loop.

Code:

#include <iostream>
using namespace std;

int main() {
    int num, factorial = 1, i = 1;
    
    // Taking input
    cout << "Enter a number: ";
    cin >> num;

    // Factorial calculation using while loop
    while (i <= num) {
        factorial *= i;
        i++;
    }

    cout << "Factorial of " << num << " is: " << factorial << endl;
    return 0;
}

Explanation:

Sample Output:

Enter a number: 5  
Factorial of 5 is: 120


Program 6: Do-While Loop (Number Guessing Game)

Objective:

To implement a simple number guessing game using a do-while loop.

Code:

#include <iostream>
#include <cstdlib>  // For rand() function
#include <ctime>    // For seeding random number
using namespace std;

int main() {
    int guess, randomNumber;
    
    // Seed random number generator
    srand(time(0));
    randomNumber = rand() % 10 + 1;  // Generate a random number between 1 and 10

    cout << "Guess a number between 1 and 10: ";

    do {
        cin >> guess;
        if (guess > randomNumber)
            cout << "Too high! Try again: ";
        else if (guess < randomNumber)
            cout << "Too low! Try again: ";
    } while (guess != randomNumber);

    cout << "Congratulations! You guessed the correct number: " << randomNumber << endl;
    return 0;
}

Explanation:

Sample Output:

Guess a number between 1 and 10: 5  
Too high! Try again: 3  
Too low! Try again: 4  
Congratulations! You guessed the correct number: 4


Program 7: Functions (Sum of Two Numbers)

Objective:

To implement a function that takes two numbers as input and returns their sum.

Code:

#include <iostream>
using namespace std;

// Function to calculate sum
int add(int a, int b) {
    return a + b;
}

int main() {
    int num1, num2;
    
    // Taking input
    cout << "Enter two numbers: ";
    cin >> num1 >> num2;

    // Function call
    int result = add(num1, num2);

    // Displaying the sum
    cout << "Sum: " << result << endl;
    
    return 0;
}

Explanation:

Sample Output:

Enter two numbers: 10 5  
Sum: 15


Program 8: Recursion (Fibonacci Series)

Objective:

To generate the Fibonacci series using a recursive function.

Code:

#include <iostream>
using namespace std;

// Recursive function to calculate Fibonacci series
int fibonacci(int n) {
    if (n <= 1)
        return n;
    return fibonacci(n - 1) + fibonacci(n - 2);
}

int main() {
    int terms;
    
    // Taking input
    cout << "Enter the number of terms: ";
    cin >> terms;

    // Printing Fibonacci series
    cout << "Fibonacci Series: ";
    for (int i = 0; i < terms; i++) {
        cout << fibonacci(i) << " ";
    }

    cout << endl;
    return 0;
}

Explanation:

Sample Output:

Enter the number of terms: 6  
Fibonacci Series: 0 1 1 2 3 5


Program 9: Arrays (Sum of Elements in an Array)

Objective:

To calculate the sum of elements in an array using a loop.

Code:

#include <iostream>
using namespace std;

int main() {
    int n, sum = 0;
    
    // Taking input for array size
    cout << "Enter the number of elements: ";
    cin >> n;

    int arr[n]; // Declare an array of size n

    // Taking input for array elements
    cout << "Enter " << n << " elements: ";
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i]; // Add each element to sum
    }

    // Displaying the sum of elements
    cout << "Sum of array elements: " << sum << endl;
    
    return 0;
}

Explanation:

Sample Output:

Enter the number of elements: 5  
Enter 5 elements: 2 4 6 8 10  
Sum of array elements: 30


Program 10: Pointers (Pointer to a Variable)

Objective:

To demonstrate the use of pointers by accessing a variable’s value and address.

Code:

#include <iostream>
using namespace std;

int main() {
    int num = 10;
    int* ptr; // Pointer declaration

    ptr = &num; // Assigning address of num to ptr

    // Displaying values and addresses
    cout << "Value of num: " << num << endl;
    cout << "Address of num: " << &num << endl;
    cout << "Value stored in ptr: " << ptr << endl;
    cout << "Value pointed to by ptr: " << *ptr << endl;

    return 0;
}

Explanation:

Sample Output:

Value of num: 10  
Address of num: 0x7ffee3c3d9ac (example address)  
Value stored in ptr: 0x7ffee3c3d9ac  
Value pointed to by ptr: 10  


Program 11: Structures (Student Record System)

Objective:

To use a structure in C++ to store and display student details.

Code:

#include <iostream>
using namespace std;

// Define a structure for Student
struct Student {
    string name;
    int rollNo;
    float marks;
};

int main() {
    Student s1; // Declare a structure variable

    // Taking input
    cout << "Enter student name: ";
    cin >> s1.name;
    cout << "Enter roll number: ";
    cin >> s1.rollNo;
    cout << "Enter marks: ";
    cin >> s1.marks;

    // Displaying student details
    cout << "\nStudent Details:\n";
    cout << "Name: " << s1.name << endl;
    cout << "Roll Number: " << s1.rollNo << endl;
    cout << "Marks: " << s1.marks << endl;

    return 0;
}

Explanation:

Sample Output:

Enter student name: Alice  
Enter roll number: 101  
Enter marks: 89.5  

Student Details:  
Name: Alice  
Roll Number: 101  
Marks: 89.5  


Program 12: Classes & Objects (Basic OOP Concept)

Objective:

To demonstrate the concept of classes and objects in C++.

Code:

#include <iostream>
using namespace std;

// Define a class
class Student {
public:
    string name;
    int rollNo;

    // Member function to display student details
    void display() {
        cout << "Student Name: " << name << endl;
        cout << "Roll Number: " << rollNo << endl;
    }
};

int main() {
    Student s1; // Creating an object of the class

    // Taking input
    cout << "Enter student name: ";
    cin >> s1.name;
    cout << "Enter roll number: ";
    cin >> s1.rollNo;

    // Calling the display function
    cout << "\nStudent Details:\n";
    s1.display();

    return 0;
}

Explanation:

Sample Output:

Enter student name: John  
Enter roll number: 102  

Student Details:  
Student Name: John  
Roll Number: 102  


Program 13: Constructors & Destructors (Employee Management System)

Objective:

To demonstrate the use of constructors and destructors in C++.

Code:

#include <iostream>
using namespace std;

class Employee {
public:
    string name;
    int id;
    double salary;

    // Constructor
    Employee(string empName, int empId, double empSalary) {
        name = empName;
        id = empId;
        salary = empSalary;
        cout << "Employee object created.\n";
    }

    // Display function
    void display() {
        cout << "Employee Name: " << name << endl;
        cout << "Employee ID: " << id << endl;
        cout << "Salary: $" << salary << endl;
    }

    // Destructor
    ~Employee() {
        cout << "Employee object destroyed.\n";
    }
};

int main() {
    string name;
    int id;
    double salary;

    // Taking input
    cout << "Enter Employee Name: ";
    cin >> name;
    cout << "Enter Employee ID: ";
    cin >> id;
    cout << "Enter Salary: ";
    cin >> salary;

    // Creating an object and calling constructor
    Employee emp(name, id, salary);

    // Displaying employee details
    cout << "\nEmployee Details:\n";
    emp.display();

    return 0;
}

Explanation:

Sample Output:

Enter Employee Name: Alice  
Enter Employee ID: 103  
Enter Salary: 50000  

Employee object created.  

Employee Details:  
Employee Name: Alice  
Employee ID: 103  
Salary: $50000  

Employee object destroyed.


Program 14: File Handling (Read & Write to a File)

Objective:

To demonstrate reading from and writing to a file in C++.

Code:

#include <iostream>
#include <fstream>  // File handling library
using namespace std;

int main() {
    string text;

    // Writing to a file
    ofstream outFile("example.txt"); // Create and open a file
    if (outFile.is_open()) {
        outFile << "Hello, this is a test file.\n";
        outFile << "C++ file handling example.\n";
        outFile.close(); // Close the file
        cout << "Data written to file successfully.\n";
    } else {
        cout << "Error opening file for writing.\n";
    }

    // Reading from a file
    ifstream inFile("example.txt"); // Open file for reading
    if (inFile.is_open()) {
        cout << "\nReading from file:\n";
        while (getline(inFile, text)) { // Read line by line
            cout << text << endl;
        }
        inFile.close(); // Close the file
    } else {
        cout << "Error opening file for reading.\n";
    }

    return 0;
}

Explanation:

Sample Output:

Data written to file successfully.

Reading from file:
Hello, this is a test file.
C++ file handling example.


Program 15: Templates (Function Template for Addition)

Objective:

To demonstrate the use of function templates in C++.

Code:

#include <iostream>
using namespace std;

// Function template for addition
template <typename T>
T add(T a, T b) {
    return a + b;
}

int main() {
    // Testing template with integers
    int int1 = 10, int2 = 20;
    cout << "Sum (int): " << add(int1, int2) << endl;

    // Testing template with floating-point numbers
    double double1 = 5.5, double2 = 2.3;
    cout << "Sum (double): " << add(double1, double2) << endl;

    return 0;
}

Explanation:

Sample Output:

Sum (int): 30  
Sum (double): 7.8  

4. VIVA VOCE – 5 MARKS

Viva will be asked from syllabus covered in Class 11 and the Project developed by Students. (वाइवा, कक्षा 11 में कवर किए गए पाठ्यक्रम और छात्रों द्वारा विकसित प्रोजेक्ट से पूछा जाएगा।)

Exit mobile version