0

๐Ÿ”ฅ Day Streak

0

โญ Points

0

๐Ÿ“ Quizzes

0h 0m

โฑ๏ธ Study Time

๐Ÿ’ก Recommended for Today

Based on your progress and weak topics

๐Ÿ“š Subject Overview

๐Ÿ“Š

Assessment & Evaluation

Test construction, validity, reliability, measurement

โ˜•

Java Programming

OOP, inheritance, exception handling, collections

๐ŸŒ

Data Communication & Networks

OSI model, TCP/IP, subnetting, routing

โš™๏ธ

Software Engineering & PM

SDLC, Agile, testing, project management

๐Ÿ”ข

Discrete Mathematics

Logic, graphs, combinatorics, cryptography

๐Ÿ“Š Ed. 452: Assessment and Evaluation in Education

Master test construction, measurement concepts, validity, reliability, and evaluation techniques for effective teaching.

๐Ÿ“š Notes
โ“ MCQs
๐Ÿ“‹ Old Questions
โšก Mini Quiz
1 Assessment and Evaluation Concepts (8 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

1.1 Concept of Test, Measurement, Assessment and Evaluation

Test: A systematic procedure for measuring a sample of behavior. It is a tool or instrument used to measure knowledge, skills, attitudes, or other characteristics.

Measurement: The process of assigning numbers or labels to objects, events, or characteristics according to specific rules. It quantifies the degree or amount of a trait.

Assessment: The systematic process of gathering, analyzing, and interpreting information about student learning. It is broader than testing and includes various methods.

Evaluation: The process of making judgments about the value or worth of something based on assessment data. It involves comparing results against standards or objectives.

Remember T-MAE: Test โ†’ Measurement โ†’ Assessment โ†’ Evaluation (from narrow to broad)
1.2 Types of Evaluation
Type Purpose Tools When Used
Diagnostic Identify learning difficulties, strengths/weaknesses Pre-tests, aptitude tests, observation Before instruction
Placement Determine appropriate level/section Entrance tests, screening tests Before instruction
Formative Monitor learning progress, provide feedback Quizzes, observations, homework During instruction
Summative Evaluate learning at end of instruction Final exams, standardized tests After instruction
Remember DFPS: Diagnostic โ†’ Formative โ†’ Placement โ†’ Summative (alphabetical order of when used)
Exam Tip: For 5-mark questions on types of evaluation, always include: definition, purpose, tools used, and when it is conducted.
2 Characteristics of a Test (10 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

2.1 Essential Qualities of a Good Test

1. Validity: The test measures what it claims to measure. Types include:

  • Content Validity: Test covers all aspects of the content domain
  • Criterion Validity: Test correlates with an external criterion
    • Concurrent: Correlates with current performance
    • Predictive: Predicts future performance
  • Construct Validity: Test measures the theoretical construct it claims to measure

2. Reliability: Consistency of test results. A reliable test gives consistent scores when administered under similar conditions.

Methods of Estimating Reliability:
Method Description Formula
Test-Retest Same test given twice to same group Correlation between two sets of scores
Parallel Form Two equivalent forms given to same group Correlation between Form A and Form B
Split-Half Test divided into two halves, scores correlated Spearman-Brown formula: r = 2rโ‚/โ‚‚/(1+rโ‚/โ‚‚)
Kuder-Richardson (KR-20) Internal consistency for dichotomous items Based on item difficulty and variance

3. Objectivity: Test results should not be influenced by the scorer's personal judgment or bias.

4. Usability: Test should be practical to administer, score, and interpret within available resources.

Remember VROU: Validity, Reliability, Objectivity, Usability - The four essential qualities of a good test
Exam Tip: For reliability methods questions: Remember T-P-S-K (Test-Retest, Parallel, Split-Half, Kuder-Richardson)
3 Construction of Teacher Made Test (12 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

3.1 Concept of Teacher Made Test

A teacher-made test is an assessment instrument prepared by the classroom teacher to measure student achievement on specific instructional objectives. Unlike standardized tests, these are tailored to specific classroom content and needs.

3.2 Purposes of Testing
  • Instructional: To guide teaching and learning
  • Grading: To assign marks/grades
  • Diagnostic: To identify learning difficulties
  • Selection: To select students for programs
  • Placement: To place students in appropriate groups
  • Counseling: To guide students in career choices
  • Curricular Decisions: To evaluate curriculum effectiveness
  • Policy Making: To inform educational policies
3.3 Types of Test Items

A. Subjective Test Items:

  • Essay Questions: Require extended written response
    • Extended Response: Long, comprehensive answers
    • Restricted Response: Short, focused answers
  • Short Answer: Brief responses (1-2 sentences)

B. Objective Test Items:

  • Multiple Choice: Stem + 4-5 options (one correct)
  • True/False: Binary choice items
  • Matching: Two columns to be paired
  • Fill in the Blanks: Complete the statement
3.4 Bloom's Taxonomy (Cognitive Domain)
Level Description Action Verbs
1. Knowledge Recall facts, terms, basic concepts Define, list, name, identify
2. Comprehension Understand meaning, interpret Explain, describe, summarize
3. Application Use knowledge in new situations Apply, solve, demonstrate
4. Analysis Break down into components Analyze, compare, contrast
5. Synthesis Combine elements to create new Create, design, formulate
6. Evaluation Make judgments based on criteria Evaluate, justify, critique
Remember KCAASE: Knowledge โ†’ Comprehension โ†’ Application โ†’ Analysis โ†’ Synthesis โ†’ Evaluation
3.5 Test Construction Process

Step 1: Planning the Test

  • Write instructional objectives
  • Prepare specification chart (blueprint)
  • Decide number of items, marks distribution

Step 2: Preparing the Test

  • Prepare test items following guidelines
  • Prepare clear instructions
  • Prepare scoring key and marking scheme
Exam Tip: For test construction questions, always mention: Planning (objectives + blueprint) โ†’ Preparation (items + instructions + scoring key)
4 Administration, Scoring and Analysis (10 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

4.1 Test Administration

Proper test administration ensures valid and reliable results:

  • Prepare testing environment (quiet, well-lit)
  • Provide clear instructions
  • Manage time effectively
  • Ensure uniform conditions for all test-takers
  • Handle test materials securely
4.2 Scoring Methods

Objective Items:

  • Right-wrong scoring (0 or full marks)
  • No partial credit

Subjective Items:

  • Analytic scoring: Break into components, score each
  • Holistic scoring: Overall impression score
  • Rubric-based scoring: Use predefined criteria
4.3 Statistical Analysis of Test Results

Measures of Central Tendency:

  • Mean: Average score. Formula: ฮฃX/N
  • Median: Middle score when arranged in order
  • Mode: Most frequently occurring score

Measures of Variability:

  • Range: Highest - Lowest score
  • Standard Deviation: Average deviation from mean. Formula: ฯƒ = โˆš(ฮฃ(X-M)ยฒ/N)
  • Variance: Square of standard deviation
4.4 Item Analysis

Difficulty Index (P): Proportion of students who answered correctly

Formula: P = R/N (where R = number correct, N = total students)

  • P = 0.20-0.80: Moderate difficulty (ideal)
  • P < 0.20: Too difficult
  • P > 0.80: Too easy

Discrimination Index (D): How well item differentiates between high and low performers

Formula: D = (Rแตค - Rโ‚—)/N/โ‚‚ (upper group correct - lower group correct)

  • D โ‰ฅ 0.40: Excellent
  • D = 0.30-0.39: Good
  • D = 0.20-0.29: Fair
  • D < 0.20: Poor (should be revised)
Remember: Difficulty = How many got it right (P). Discrimination = How well it separates good/bad students (D).
5 Current Student Assessment System in Nepal (8 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

5.1 National Examination System

SEE (Secondary Education Examination):

  • Conducted at the end of Grade 10
  • Replaced SLC (School Leaving Certificate) in 2073 BS
  • Grade point system (GPA 0-4)

NEB (National Examinations Board):

  • Conducts Grade 11 and 12 examinations
  • Replaced HSEB (Higher Secondary Education Board)
5.2 Internal Assessment System

As per NEB guidelines, internal assessment contributes 25% to final grades:

  • Attendance: 5 marks
  • Class participation/activities: 5 marks
  • Project work/Assignment: 10 marks
  • Internal examination: 5 marks
5.3 Continuous Assessment System (CAS)

CAS involves regular assessment throughout the academic session rather than single final exams:

  • Regular quizzes and tests
  • Project works
  • Practical assessments
  • Portfolio assessment
5.4 Grading System
Grade GPA Percentage Description
A+ 4.0 90-100 Outstanding
A 3.6 80-89 Excellent
B+ 3.2 70-79 Very Good
B 2.8 60-69 Good
C+ 2.4 50-59 Satisfactory
C 2.0 40-49 Acceptable
D+ 1.6 30-39 Partially Acceptable
D 1.2 20-29 Insufficient
E 0.8 Below 20 Very Insufficient
Exam Tip: For questions on Nepal's assessment system, mention: SEE, NEB, Internal Assessment (25%), CAS, and the GPA system.

๐Ÿ“‹ Old Questions with Answers

2079 - Short Question 5 Marks
Differentiate between measurement and evaluation with examples.
Detailed Answer:
Aspect Measurement Evaluation
Definition Process of assigning numbers to characteristics according to rules Process of making judgments about value or worth
Focus Quantification (how much) Qualitative judgment (how good)
Result Score, number, or grade Decision, interpretation, or judgment
Example A student scored 85 marks in math The student's performance is excellent
Scope Narrow - only quantifies Broad - includes interpretation

Key Relationship: Measurement provides data for evaluation. Evaluation uses measurement data to make judgments. Example: Measuring height (5 feet) vs Evaluating if height is good for basketball.

2078 - Long Question 10 Marks
Explain the different types of evaluation with their purposes, tools, and uses.
Detailed Answer:

1. Diagnostic Evaluation

  • Purpose: Identify learning difficulties, strengths, and weaknesses before instruction
  • Tools: Pre-tests, aptitude tests, observation checklists, interviews
  • Uses: Plan remedial teaching, identify prerequisite knowledge gaps

2. Placement Evaluation

  • Purpose: Determine appropriate level, section, or group for a student
  • Tools: Entrance tests, screening tests, achievement tests
  • Uses: Section allocation, course selection, grouping students

3. Formative Evaluation

  • Purpose: Monitor learning progress during instruction and provide feedback
  • Tools: Quizzes, observations, homework, class discussions
  • Uses: Improve teaching strategies, provide immediate feedback to students

4. Summative Evaluation

  • Purpose: Evaluate learning at the end of instruction period
  • Tools: Final exams, standardized tests, term-end assessments
  • Uses: Assign grades, certify competence, compare performance
2078 - Short Question 5 Marks
What is validity? Describe the different types of validity.
Detailed Answer:

Definition: Validity refers to the extent to which a test measures what it claims to measure. It is the most important quality of a test.

Types of Validity:

1. Content Validity:

  • The extent to which test items represent the content domain being measured
  • Ensures all important topics are covered
  • Determined by expert judgment and test blueprint analysis

2. Criterion Validity:

  • The extent to which test scores correlate with an external criterion
  • Concurrent: Correlation with current performance (measured at same time)
  • Predictive: Prediction of future performance (measured later)

3. Construct Validity:

  • The extent to which test measures the theoretical construct it claims to measure
  • Example: Does an IQ test really measure intelligence?
  • Established through various studies over time
2079 - Long Question 10 Marks
Explain the methods of estimating reliability with their advantages and limitations.
Detailed Answer:

1. Test-Retest Method

  • Procedure: Same test administered to same group twice with time gap
  • Advantages: Simple to conduct, uses same test
  • Limitations: Practice effect, memory effect, time gap issues

2. Parallel Forms Method

  • Procedure: Two equivalent forms given to same group
  • Advantages: No practice effect, tests content sampling
  • Limitations: Difficult to create truly parallel forms, time-consuming

3. Split-Half Method

  • Procedure: Test divided into two halves, scores correlated
  • Formula: Spearman-Brown: r = 2rโ‚/โ‚‚/(1+rโ‚/โ‚‚)
  • Advantages: Quick, single administration
  • Limitations: Affected by how items are split

4. Kuder-Richardson Method (KR-20)

  • Procedure: Internal consistency based on item statistics
  • Advantages: No need to split test, uses all items
  • Limitations: Only for dichotomous items, requires item analysis data
2080 - Short Question 5 Marks
What is a specification chart? How is it prepared for test construction?
Detailed Answer:

Definition: A specification chart (or test blueprint) is a table that shows the distribution of test items across different content areas and cognitive levels. It ensures balanced coverage of the curriculum.

Steps to Prepare:

  1. List Content Areas: Identify all topics/units to be tested
  2. List Cognitive Levels: Use Bloom's taxonomy (Knowledge, Comprehension, Application, Analysis, Synthesis, Evaluation)
  3. Decide Weightage: Allocate marks/time based on importance and teaching time
  4. Create Matrix: Make a table with content areas as rows and cognitive levels as columns
  5. Fill the Cells: Write number of items/marks for each cell
  6. Review: Ensure total matches desired test length

Example Structure:

Content Area Knowledge Comprehension Application Total
Unit 12215
Unit 22327
Unit 33238

Old questions are included in the Notes tab above.

โ˜• ICT.Ed 455: Java Programming Language

Master object-oriented programming with Java - from basics to advanced concepts like inheritance, polymorphism, exception handling, and collections.

๐Ÿ“š Notes
โ“ MCQs
๐Ÿ“‹ Old Questions
โšก Mini Quiz
1 Introduction to Java (3 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

1.1 Java as a Programming Platform

Java is a high-level, object-oriented programming language developed by Sun Microsystems (now Oracle) in 1995. It is designed to be:

  • Platform Independent: "Write Once, Run Anywhere" (WORA) - Java code runs on any platform with JVM
  • Object-Oriented: Everything is organized in classes and objects
  • Secure: No direct memory access, bytecode verification
  • Robust: Strong type checking, automatic memory management
1.2 The Java "White Paper" Buzzwords
Feature Description
Simple Easy to learn, similar to C++ but removes complex features
Object-Oriented Everything is an object, supports encapsulation, inheritance, polymorphism
Distributed Built-in networking capabilities, supports RMI, CORBA
Robust Strong memory management, exception handling, type checking
Secure Bytecode verification, no pointer arithmetic, sandbox security
Architecture Neutral Bytecode runs on any architecture with JVM
Portable Same code runs on Windows, Linux, Mac
Interpreted Bytecode is interpreted by JVM (now JIT compiled)
High Performance JIT compilation, garbage collection optimization
Multithreaded Built-in support for concurrent programming
Dynamic Runtime linking, dynamic class loading
Remember SODRS PIPMHD: Simple, Object-Oriented, Distributed, Robust, Secure, Portable, Interpreted, High Performance, Multithreaded, Dynamic
1.3 JVM, JRE, and JDK

JVM (Java Virtual Machine):

  • Abstract computing machine that executes Java bytecode
  • Provides platform independence
  • Components: Class Loader, Bytecode Verifier, Execution Engine

JRE (Java Runtime Environment):

  • JVM + Java class libraries + supporting files
  • Required to run Java programs

JDK (Java Development Kit):

  • JRE + Development tools (javac, javadoc, debugger)
  • Required to develop Java programs
Remember: JDK โŠƒ JRE โŠƒ JVM (JDK contains JRE, JRE contains JVM)
2 Fundamental Programming Structures (12 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

2.1 Basic Data Types in Java
Type Size Range Default Value
byte 1 byte -128 to 127 0
short 2 bytes -32,768 to 32,767 0
int 4 bytes -2ยณยน to 2ยณยน-1 0
long 8 bytes -2โถยณ to 2โถยณ-1 0L
float 4 bytes ยฑ3.4E-38 to ยฑ3.4E+38 0.0f
double 8 bytes ยฑ1.7E-308 to ยฑ1.7E+308 0.0d
char 2 bytes 0 to 65,535 (Unicode) '\u0000'
boolean 1 bit true or false false
Remember sizes: byte(1) < short(2) < int(4) < long(8). Float(4) and Double(8) follow the same pattern.
2.2 Control Flow Statements

Conditional Statements:

// if-else
if (condition) {
    // code
} else if (anotherCondition) {
    // code
} else {
    // code
}

// switch-case
switch (variable) {
    case value1:
        // code
        break;
    case value2:
        // code
        break;
    default:
        // code
}

Loop Statements:

// for loop
for (int i = 0; i < 10; i++) {
    // code
}

// while loop
while (condition) {
    // code
}

// do-while loop
do {
    // code
} while (condition);

// enhanced for loop (for-each)
for (Type item : collection) {
    // code
}

Jump Statements:

  • break: Exits the loop or switch
  • continue: Skips current iteration
  • return: Exits method and returns value
2.3 Arrays in Java
// Declaration and initialization
int[] numbers = new int[5];           // size 5 array
int[] nums = {1, 2, 3, 4, 5};         // initialized array
int[][] matrix = new int[3][3];       // 2D array

// Array methods
int length = numbers.length;          // get length
Arrays.sort(numbers);                 // sort array
Arrays.toString(numbers);             // convert to string
Exam Tip: Array index starts at 0. Array length is a property (numbers.length), not a method.
3 Objects and Classes (10 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

3.1 Object-Oriented Programming Concepts

Class: A blueprint/template that defines properties (fields) and behaviors (methods) of objects.

Object: An instance of a class. It has state (data) and behavior (methods).

// Class definition
public class Student {
    // Fields (instance variables)
    private String name;
    private int age;
    private static int studentCount = 0;  // static variable
    
    // Constructor
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        studentCount++;
    }
    
    // Methods
    public void study() {
        System.out.println(name + " is studying");
    }
    
    // Getters and Setters
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    
    // Static method
    public static int getStudentCount() { return studentCount; }
}
3.2 The Four Pillars of OOP

1. Encapsulation: Wrapping data and methods together, hiding internal details

  • Uses private fields with public getters/setters
  • Protects data from unauthorized access

2. Inheritance: Creating new classes from existing ones

  • Uses 'extends' keyword
  • Child class inherits parent's fields and methods
  • Promotes code reusability

3. Polymorphism: Same interface, different implementations

  • Compile-time: Method overloading
  • Runtime: Method overriding

4. Abstraction: Hiding implementation details, showing only functionality

  • Achieved through abstract classes and interfaces
Remember EI-PA: Encapsulation, Inheritance, Polymorphism, Abstraction
3.3 Static vs Instance Members
Aspect Static Instance
Belongs to Class Object
Memory Allocated once Allocated per object
Access ClassName.member object.member
Keyword static No keyword
4 Inheritance and Interfaces (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

4.1 Inheritance in Java
// Parent class
class Animal {
    protected String name;
    
    public void eat() {
        System.out.println("Animal is eating");
    }
}

// Child class
class Dog extends Animal {
    public void bark() {
        System.out.println("Dog is barking");
    }
    
    // Method overriding
    @Override
    public void eat() {
        System.out.println("Dog is eating");
    }
}

Types of Inheritance:

  • Single: One child extends one parent
  • Multilevel: A โ†’ B โ†’ C (chain)
  • Hierarchical: One parent, multiple children
  • Multiple: One child, multiple parents (NOT supported in Java with classes)
4.2 Polymorphism

Method Overloading (Compile-time Polymorphism):

class Calculator {
    // Same method name, different parameters
    int add(int a, int b) { return a + b; }
    double add(double a, double b) { return a + b; }
    int add(int a, int b, int c) { return a + b + c; }
}

Method Overriding (Runtime Polymorphism):

class Parent {
    void show() { System.out.println("Parent"); }
}

class Child extends Parent {
    @Override
    void show() { System.out.println("Child"); }
}

// Usage
Parent obj = new Child();  // Upcasting
obj.show();  // Outputs: Child (runtime binding)
4.3 Abstract Classes
abstract class Shape {
    abstract void draw();  // abstract method (no body)
    
    void display() {       // concrete method
        System.out.println("Displaying shape");
    }
}

class Circle extends Shape {
    @Override
    void draw() {
        System.out.println("Drawing circle");
    }
}
4.4 Interfaces
interface Drawable {
    void draw();           // implicitly public abstract
    default void print() { // default method (Java 8+)
        System.out.println("Printing...");
    }
    static void info() {   // static method (Java 8+)
        System.out.println("Drawable interface");
    }
}

class Rectangle implements Drawable {
    @Override
    public void draw() {
        System.out.println("Drawing rectangle");
    }
}
Aspect Abstract Class Interface
Methods Can have abstract and concrete methods Only abstract methods (before Java 8)
Variables Can have any type Only public static final (constants)
Constructor Yes No
Multiple inheritance No (single class inheritance) Yes (multiple interface implementation)
Keyword extends implements
Exam Tip: Use abstract class for "is-a" relationship with shared code. Use interface for "can-do" relationship defining contracts.
5 Exception Handling and Multithreading (3 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

5.1 Exception Hierarchy
Throwable
โ”œโ”€โ”€ Error (Unchecked - cannot handle)
โ”‚   โ”œโ”€โ”€ OutOfMemoryError
โ”‚   โ””โ”€โ”€ StackOverflowError
โ””โ”€โ”€ Exception
    โ”œโ”€โ”€ RuntimeException (Unchecked)
    โ”‚   โ”œโ”€โ”€ NullPointerException
    โ”‚   โ”œโ”€โ”€ ArrayIndexOutOfBoundsException
    โ”‚   โ””โ”€โ”€ ArithmeticException
    โ””โ”€โ”€ Other Exceptions (Checked)
        โ”œโ”€โ”€ IOException
        โ”œโ”€โ”€ SQLException
        โ””โ”€โ”€ FileNotFoundException
5.2 Exception Handling Keywords
// try-catch-finally
try {
    // Code that may throw exception
    int result = 10 / 0;
} catch (ArithmeticException e) {
    // Handle specific exception
    System.out.println("Cannot divide by zero");
} catch (Exception e) {
    // Handle any other exception
    System.out.println("Error: " + e.getMessage());
} finally {
    // Always executes
    System.out.println("Cleanup code");
}

// throw - explicitly throw exception
if (age < 0) {
    throw new IllegalArgumentException("Age cannot be negative");
}

// throws - declare exceptions in method signature
public void readFile() throws IOException, FileNotFoundException {
    // Method code
}
Keyword Use Location
try Enclose risky code Block
catch Handle exception After try
finally Cleanup code After catch
throw Explicitly throw exception Inside method
throws Declare possible exceptions Method signature
Remember: try-catch-finally always together. throw inside, throws outside (signature).
5.3 Multithreading Basics
// Method 1: Extend Thread class
class MyThread extends Thread {
    @Override
    public void run() {
        // Thread code
        for (int i = 0; i < 5; i++) {
            System.out.println("Thread: " + i);
        }
    }
}

// Method 2: Implement Runnable interface
class MyRunnable implements Runnable {
    @Override
    public void run() {
        // Thread code
    }
}

// Usage
MyThread t1 = new MyThread();
t1.start();  // Starts new thread

Thread t2 = new Thread(new MyRunnable());
t2.start();

Thread States: New โ†’ Runnable โ†’ Running โ†’ Blocked/Waiting โ†’ Terminated

6 Input/Output (4 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

6.1 I/O Streams

Byte Streams: Handle raw binary data (8-bit)

  • InputStream, OutputStream (abstract base classes)
  • FileInputStream, FileOutputStream
  • BufferedInputStream, BufferedOutputStream

Character Streams: Handle Unicode characters (16-bit)

  • Reader, Writer (abstract base classes)
  • FileReader, FileWriter
  • BufferedReader, BufferedWriter
6.2 File Operations
// Reading from file
BufferedReader reader = new BufferedReader(new FileReader("file.txt"));
String line;
while ((line = reader.readLine()) != null) {
    System.out.println(line);
}
reader.close();

// Writing to file
BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"));
writer.write("Hello World");
writer.newLine();
writer.close();

// Using try-with-resources (Java 7+)
try (BufferedReader br = new BufferedReader(new FileReader("file.txt"))) {
    String line;
    while ((line = br.readLine()) != null) {
        System.out.println(line);
    }
}  // Automatically closes
6.3 Scanner Class
import java.util.Scanner;

Scanner scanner = new Scanner(System.in);

System.out.print("Enter name: ");
String name = scanner.nextLine();

System.out.print("Enter age: ");
int age = scanner.nextInt();

System.out.print("Enter salary: ");
double salary = scanner.nextDouble();

scanner.close();
7 Event Handling and Swing (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

7.1 Event Handling Model

Delegation Event Model:

  • Event Source: Component that generates events (button, text field)
  • Event Object: Contains information about the event
  • Event Listener: Interface that receives and handles events
// Event handling using anonymous inner class
JButton button = new JButton("Click Me");
button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("Button clicked!");
    }
});

// Using Lambda expression (Java 8+)
button.addActionListener(e -> {
    System.out.println("Button clicked!");
});
7.2 Common Event Listeners
Listener Methods Used For
ActionListener actionPerformed() Buttons, menu items
MouseListener mouseClicked(), mousePressed(), mouseReleased(), mouseEntered(), mouseExited() Mouse events
KeyListener keyPressed(), keyReleased(), keyTyped() Keyboard events
WindowListener windowOpened(), windowClosing(), windowClosed(), etc. Window events
7.3 Basic Swing Components
import javax.swing.*;

public class SimpleGUI {
    public static void main(String[] args) {
        // Create frame
        JFrame frame = new JFrame("My Application");
        frame.setSize(400, 300);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLayout(new FlowLayout());
        
        // Add components
        JLabel label = new JLabel("Enter name:");
        JTextField textField = new JTextField(20);
        JButton button = new JButton("Submit");
        
        // Add event listener
        button.addActionListener(e -> {
            String name = textField.getText();
            JOptionPane.showMessageDialog(frame, "Hello, " + name);
        });
        
        // Add to frame
        frame.add(label);
        frame.add(textField);
        frame.add(button);
        
        frame.setVisible(true);
    }
}

Common Layout Managers:

  • FlowLayout: Components flow left to right
  • BorderLayout: NORTH, SOUTH, EAST, WEST, CENTER
  • GridLayout: Rows and columns
8 Java Database Connectivity (4 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

8.1 JDBC Architecture

JDBC (Java Database Connectivity) is an API that allows Java programs to interact with databases.

  • JDBC Driver: Interface between Java application and database
  • Connection: Establishes connection to database
  • Statement: Executes SQL queries
  • ResultSet: Stores query results
8.2 JDBC Steps
import java.sql.*;

public class JDBCDemo {
    public static void main(String[] args) {
        try {
            // Step 1: Load driver (optional in newer Java versions)
            Class.forName("com.mysql.cj.jdbc.Driver");
            
            // Step 2: Create connection
            String url = "jdbc:mysql://localhost:3306/mydb";
            String user = "root";
            String password = "password";
            Connection conn = DriverManager.getConnection(url, user, password);
            
            // Step 3: Create statement
            Statement stmt = conn.createStatement();
            
            // Step 4: Execute query
            ResultSet rs = stmt.executeQuery("SELECT * FROM students");
            
            // Step 5: Process results
            while (rs.next()) {
                int id = rs.getInt("id");
                String name = rs.getString("name");
                System.out.println(id + ": " + name);
            }
            
            // Step 6: Close resources
            rs.close();
            stmt.close();
            conn.close();
            
        } catch (ClassNotFoundException | SQLException e) {
            e.printStackTrace();
        }
    }
}
8.3 Types of Statements
Statement Type Use Example
Statement Simple queries without parameters stmt.executeQuery("SELECT * FROM table")
PreparedStatement Parameterized queries (prevents SQL injection) PreparedStatement ps = conn.prepareStatement("INSERT INTO table VALUES (?, ?)")
CallableStatement Execute stored procedures CallableStatement cs = conn.prepareCall("{call procedureName()}")
Exam Tip: Always use PreparedStatement for user input to prevent SQL injection attacks.

๐Ÿ“‹ Old Questions with Answers

2079 - Short Question 5 Marks
Differentiate between abstract class and interface with examples.
Detailed Answer:
Aspect Abstract Class Interface
Definition Class with at least one abstract method Collection of abstract methods (contract)
Methods Can have abstract and concrete methods Only abstract methods (Java 7 and before)
Variables Any type of variables Only public static final (constants)
Constructor Can have constructors No constructors
Multiple inheritance Not supported (single inheritance) Supported (can implement multiple)
Keyword extends implements
// Abstract Class Example
abstract class Animal {
    abstract void makeSound();  // abstract method
    void sleep() {              // concrete method
        System.out.println("Sleeping...");
    }
}

// Interface Example
interface Drawable {
    void draw();  // abstract method
    default void print() {  // default method (Java 8+)
        System.out.println("Printing...");
    }
}
2078 - Long Question 10 Marks
Explain the four pillars of Object-Oriented Programming with examples.
Detailed Answer:

1. Encapsulation

Wrapping data (variables) and code (methods) together into a single unit (class) and hiding internal details from the outside world.

class Student {
    private String name;  // private data
    private int age;
    
    // public getters and setters
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
}

Benefits: Data hiding, controlled access, flexibility to change implementation

2. Inheritance

Creating new classes from existing ones, inheriting properties and behaviors. Promotes code reusability.

class Animal {
    void eat() { System.out.println("Eating..."); }
}
class Dog extends Animal {
    void bark() { System.out.println("Barking..."); }
}

Benefits: Code reusability, establishes "is-a" relationship

3. Polymorphism

Ability to take multiple forms. Same interface, different implementations.

// Method Overloading (Compile-time)
class Calculator {
    int add(int a, int b) { return a + b; }
    double add(double a, double b) { return a + b; }
}

// Method Overriding (Runtime)
class Parent {
    void show() { System.out.println("Parent"); }
}
class Child extends Parent {
    @Override
    void show() { System.out.println("Child"); }
}

Benefits: Flexibility, extensibility, loose coupling

4. Abstraction

Hiding implementation details and showing only functionality. Achieved through abstract classes and interfaces.

abstract class Shape {
    abstract void draw();  // hide implementation
}
class Circle extends Shape {
    void draw() { System.out.println("Drawing circle"); }
}

Benefits: Reduces complexity, increases maintainability

2080 - Short Question 5 Marks
What is exception handling? Explain try-catch-finally with an example.
Detailed Answer:

Exception Handling: A mechanism to handle runtime errors gracefully without crashing the program. It separates error-handling code from normal code.

Keywords:

  • try: Block containing code that might throw exception
  • catch: Block that handles the exception
  • finally: Block that always executes (for cleanup)
  • throw: Explicitly throws an exception
  • throws: Declares exceptions in method signature
public class ExceptionDemo {
    public static void main(String[] args) {
        try {
            int a = 10;
            int b = 0;
            int result = a / b;  // Throws ArithmeticException
            System.out.println("Result: " + result);
        } catch (ArithmeticException e) {
            System.out.println("Error: Cannot divide by zero!");
            System.out.println("Exception message: " + e.getMessage());
        } catch (Exception e) {
            System.out.println("General error: " + e);
        } finally {
            System.out.println("Finally block always executes");
            // Cleanup code: close files, release resources
        }
        System.out.println("Program continues...");
    }
}

Output:

Error: Cannot divide by zero!
Exception message: / by zero
Finally block always executes
Program continues...
2078 - Short Question 5 Marks
Explain method overloading and method overriding with examples.
Detailed Answer:

Method Overloading (Compile-time Polymorphism):

Same method name with different parameters within the same class.

class Calculator {
    // Overloaded methods
    int add(int a, int b) {
        return a + b;
    }
    
    int add(int a, int b, int c) {
        return a + b + c;
    }
    
    double add(double a, double b) {
        return a + b;
    }
}

// Usage
Calculator calc = new Calculator();
calc.add(5, 3);        // calls first method
calc.add(5, 3, 2);     // calls second method
calc.add(5.5, 3.5);    // calls third method

Rules: Different number or type of parameters. Return type alone doesn't differentiate.

Method Overriding (Runtime Polymorphism):

Same method signature in parent and child class. Child provides specific implementation.

class Animal {
    void makeSound() {
        System.out.println("Animal makes sound");
    }
}

class Dog extends Animal {
    @Override
    void makeSound() {
        System.out.println("Dog barks");
    }
}

// Usage
Animal animal = new Dog();  // Upcasting
animal.makeSound();  // Output: Dog barks (runtime binding)

Rules: Same name, parameters, return type. Use @Override annotation. Can't reduce visibility.

Aspect Overloading Overriding
Class Same class Parent-child classes
Parameters Must be different Must be same
Return type Can be different Must be same (or covariant)
Binding Compile-time Runtime
Polymorphism Static Dynamic
2079 - Long Question 10 Marks
Write a Java program to create a simple calculator using Swing with event handling.
Detailed Answer:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Calculator extends JFrame implements ActionListener {
    JTextField display;
    double num1 = 0, num2 = 0, result = 0;
    char operator;
    
    public Calculator() {
        // Frame setup
        setTitle("Simple Calculator");
        setSize(300, 400);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLayout(new BorderLayout());
        
        // Display field
        display = new JTextField();
        display.setFont(new Font("Arial", Font.BOLD, 24));
        display.setHorizontalAlignment(JTextField.RIGHT);
        display.setEditable(false);
        add(display, BorderLayout.NORTH);
        
        // Button panel
        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(4, 4, 5, 5));
        
        // Button labels
        String[] buttons = {
            "7", "8", "9", "/",
            "4", "5", "6", "*",
            "1", "2", "3", "-",
            "0", "C", "=", "+"
        };
        
        // Create buttons
        for (String text : buttons) {
            JButton button = new JButton(text);
            button.setFont(new Font("Arial", Font.BOLD, 18));
            button.addActionListener(this);
            panel.add(button);
        }
        
        add(panel, BorderLayout.CENTER);
        setVisible(true);
    }
    
    @Override
    public void actionPerformed(ActionEvent e) {
        String command = e.getActionCommand();
        
        if (command.charAt(0) >= '0' && command.charAt(0) <= '9') {
            // Number button
            display.setText(display.getText() + command);
        } else if (command.equals("C")) {
            // Clear
            display.setText("");
            num1 = num2 = result = 0;
        } else if (command.equals("=")) {
            // Calculate
            num2 = Double.parseDouble(display.getText());
            switch (operator) {
                case '+': result = num1 + num2; break;
                case '-': result = num1 - num2; break;
                case '*': result = num1 * num2; break;
                case '/': 
                    if (num2 != 0) result = num1 / num2;
                    else {
                        display.setText("Error");
                        return;
                    }
                    break;
            }
            display.setText(String.valueOf(result));
        } else {
            // Operator
            num1 = Double.parseDouble(display.getText());
            operator = command.charAt(0);
            display.setText("");
        }
    }
    
    public static void main(String[] args) {
        new Calculator();
    }
}

Old questions are included in the Notes tab above.

๐ŸŒ ICT.Ed 456: Data Communication and Networks

Understand network fundamentals, OSI and TCP/IP models, subnetting, routing protocols, and network security.

๐Ÿ“š Notes
โ“ MCQs
๐Ÿ“‹ Old Questions
โšก Mini Quiz
1 Introduction to Data Communication (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

1.1 Components of Data Communication

Data Communication is the exchange of data between two devices via some transmission medium.

Five Components:

  1. Message: The information/data to be communicated (text, audio, video)
  2. Sender: Device that sends the message (computer, phone)
  3. Receiver: Device that receives the message
  4. Transmission Medium: Physical path (cable, air for wireless)
  5. Protocol: Set of rules governing communication
Remember SMRTP: Sender, Message, Receiver, Transmission Medium, Protocol
1.2 Data Representation and Data Flow

Data Flow Directions:

Mode Description Example
Simplex One-way communication only Keyboard to computer, TV broadcast
Half-Duplex Both ways, but not simultaneously Walkie-talkie
Full-Duplex Both ways simultaneously Telephone, mobile communication
1.3 Network Criteria and Physical Structures

Network Criteria:

  • Performance: Measured by throughput, delay, jitter
  • Reliability: Frequency of failure, recovery time
  • Security: Protection against unauthorized access

Network Topologies:

Topology Description Advantages Disadvantages
Bus Single backbone cable Easy to install, less cable Difficult to troubleshoot, single point of failure
Star All devices connect to central hub Easy to manage, fault isolation Hub failure affects all, more cable
Ring Each device connected to two others Equal access, easy to install One failure breaks ring
Mesh Every device connected to every other High redundancy, robust Expensive, complex, lots of cable
2 OSI Model and TCP/IP Protocol Suite (8 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

2.1 OSI Model (Open Systems Interconnection)

Developed by ISO in 1984. Seven layers that standardize network communication.

Layer Name Function Protocols/Devices Data Unit
7 Application Network services to applications HTTP, FTP, SMTP, DNS Message
6 Presentation Data translation, encryption, compression SSL, JPEG, ASCII Message
5 Session Session management, dialog control NetBIOS, RPC Message
4 Transport End-to-end delivery, flow control TCP, UDP Segment
3 Network Logical addressing, routing IP, ICMP, Router Packet
2 Data Link Physical addressing, framing, error detection MAC, Ethernet, Switch Frame
1 Physical Bit transmission, physical connection Cables, Hubs, Repeaters Bit
Remember: "Please Do Not Throw Sausage Pizza Away" (PDNTSPA) - Physical, Data Link, Network, Transport, Session, Presentation, Application
2.2 TCP/IP Model

Developed by DARPA. Four layers that are the foundation of the Internet.

Layer OSI Equivalent Protocols
4. Application Session + Presentation + Application HTTP, FTP, SMTP, DNS, Telnet
3. Transport Transport TCP, UDP
2. Internet Network IP, ICMP, ARP
1. Network Access Physical + Data Link Ethernet, Wi-Fi, PPP
2.3 OSI vs TCP/IP Comparison
Aspect OSI TCP/IP
Layers 7 layers 4 layers
Developed by ISO (theoretical) DARPA (practical)
Approach Vertical approach Horizontal approach
Protocol dependency Protocol independent Protocol dependent
Usage Reference model Implementation model
Exam Tip: For OSI model questions, always write layers from 7 to 1 with their functions. For TCP/IP, remember it has 4 layers combining OSI layers.
3 IP Addressing and Subnetting (8 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

3.1 IP Address

An IP address is a unique 32-bit (IPv4) or 128-bit (IPv6) identifier assigned to each device on a network.

IPv4 Address Classes:

Class First Bits Range Default Mask Use
A 0 1.0.0.0 - 126.255.255.255 255.0.0.0 (/8) Large networks
B 10 128.0.0.0 - 191.255.255.255 255.255.0.0 (/16) Medium networks
C 110 192.0.0.0 - 223.255.255.255 255.255.255.0 (/24) Small networks
D 1110 224.0.0.0 - 239.255.255.255 - Multicast
E 1111 240.0.0.0 - 255.255.255.255 - Reserved/Experimental
Remember: Class A (1-126), Class B (128-191), Class C (192-223), Class D (224-239), Class E (240-255)

Private IP Ranges (RFC 1918):

  • Class A: 10.0.0.0 - 10.255.255.255
  • Class B: 172.16.0.0 - 172.31.255.255
  • Class C: 192.168.0.0 - 192.168.255.255
3.2 Subnetting

Subnetting divides a network into smaller subnetworks to improve efficiency and security.

Key Formulas:

  • Number of subnets: 2โฟ (n = borrowed bits)
  • Hosts per subnet: 2สฐ - 2 (h = host bits)
  • Block size: 256 - subnet mask octet value

Example: Subnet 192.168.1.0/24 into 4 subnets

  1. Need 4 subnets: 2โฟ โ‰ฅ 4, so n = 2 bits borrowed
  2. New subnet mask: /24 + 2 = /26 (255.255.255.192)
  3. Block size: 256 - 192 = 64
  4. Subnets: 0, 64, 128, 192
Subnet Network Address Usable Range Broadcast
1 192.168.1.0/26 192.168.1.1 - 192.168.1.62 192.168.1.63
2 192.168.1.64/26 192.168.1.65 - 192.168.1.126 192.168.1.127
3 192.168.1.128/26 192.168.1.129 - 192.168.1.190 192.168.1.191
4 192.168.1.192/26 192.168.1.193 - 192.168.1.254 192.168.1.255
Subnetting Steps: 1) Find bits to borrow 2) New mask 3) Block size 4) List subnets
3.3 CIDR (Classless Inter-Domain Routing)

CIDR replaces classful addressing with flexible prefix notation (/n).

Benefits:

  • More efficient IP address allocation
  • Reduces routing table size
  • Enables VLSM (Variable Length Subnet Masking)
4 Transport Layer Protocols (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

4.1 TCP (Transmission Control Protocol)

Connection-oriented, reliable transport protocol.

Key Features:

  • Connection-oriented: Three-way handshake before data transfer
  • Reliable: Acknowledgments, retransmissions, sequencing
  • Flow Control: Sliding window protocol
  • Error Control: Checksums, ACKs, retransmission
  • Full-duplex: Both directions simultaneously

Three-Way Handshake:

  1. SYN: Client sends SYN to server
  2. SYN-ACK: Server responds with SYN-ACK
  3. ACK: Client sends ACK, connection established
4.2 UDP (User Datagram Protocol)

Connectionless, unreliable transport protocol.

Key Features:

  • Connectionless: No handshake, sends data immediately
  • Unreliable: No acknowledgments or retransmissions
  • Fast: Low overhead, minimal delay
  • Small header: 8 bytes vs TCP's 20 bytes
4.3 TCP vs UDP Comparison
Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability Reliable (guaranteed delivery) Unreliable
Ordering In-order delivery No ordering
Header Size 20-60 bytes 8 bytes
Speed Slower Faster
Use Cases HTTP, FTP, Email DNS, Streaming, Gaming

Common Port Numbers:

Port Protocol Service
20, 21TCPFTP
22TCPSSH
23TCPTelnet
25TCPSMTP
53UDP/TCPDNS
80TCPHTTP
110TCPPOP3
143TCPIMAP
443TCPHTTPS
Remember: TCP = Reliable but slow. UDP = Fast but unreliable. Choose based on application needs.
5 Network Layer and Routing (8 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

5.1 Network Layer Functions
  • Logical Addressing: IP addresses for host identification
  • Routing: Determining best path for packets
  • Packetizing: Encapsulating data into packets
  • Fragmentation: Breaking large packets for different MTUs
5.2 Routing Algorithms

Distance Vector Routing (RIP):

  • Each router shares its entire routing table with neighbors
  • Uses Bellman-Ford algorithm
  • Metric: Hop count (max 15)
  • Slow convergence, count-to-infinity problem

Link State Routing (OSPF):

  • Each router knows complete network topology
  • Uses Dijkstra's shortest path algorithm
  • Metric: Cost (bandwidth-based)
  • Fast convergence, more complex
Aspect Distance Vector (RIP) Link State (OSPF)
Algorithm Bellman-Ford Dijkstra
Information Routing table to neighbors Topology to all routers
Convergence Slow Fast
Metric Hop count Cost/Bandwidth
Scalability Small networks Large networks
5.3 Network Address Translation (NAT)

NAT translates private IP addresses to public IP addresses.

Types:

  • Static NAT: One-to-one mapping (private โ†” public)
  • Dynamic NAT: Maps to pool of public IPs
  • PAT/NAPT: Many-to-one using port numbers (most common)

Benefits: Conserves public IPs, hides internal network, adds security.

5.4 DNS (Domain Name System)

Translates domain names to IP addresses.

DNS Resolution Process:

  1. Browser checks local cache
  2. Queries Local DNS Server (ISP)
  3. Local DNS queries Root DNS Server
  4. Root refers to TLD Server (.com, .org)
  5. TLD refers to Authoritative DNS Server
  6. Authoritative Server returns IP address

DNS Record Types:

Record Purpose
AMaps domain to IPv4 address
AAAAMaps domain to IPv6 address
CNAMECanonical name (alias)
MXMail exchange server
NSName server for domain
TXTText information (SPF, DKIM)

๐Ÿ“‹ Old Questions with Answers

2079 - Short Question 5 Marks
Explain the OSI model with its seven layers and their functions.
Detailed Answer:

The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes network communication into seven layers. Each layer performs specific functions and communicates with adjacent layers.

  1. Physical Layer (Layer 1): Transmits raw bits over physical medium. Deals with cables, connectors, electrical signals. Devices: Hub, Repeater. Data unit: Bit.
  2. Data Link Layer (Layer 2): Provides node-to-node delivery. Handles framing, physical addressing (MAC), error detection. Devices: Switch, Bridge. Data unit: Frame.
  3. Network Layer (Layer 3): Handles logical addressing and routing. Determines best path for packets. Protocols: IP, ICMP. Devices: Router. Data unit: Packet.
  4. Transport Layer (Layer 4): Provides end-to-end delivery. Handles segmentation, flow control, error control. Protocols: TCP, UDP. Data unit: Segment.
  5. Session Layer (Layer 5): Establishes, manages, and terminates sessions. Handles dialog control and synchronization.
  6. Presentation Layer (Layer 6): Translates data formats. Handles encryption, compression, character encoding.
  7. Application Layer (Layer 7): Provides network services to applications. Protocols: HTTP, FTP, SMTP, DNS.
Remember: "Please Do Not Throw Sausage Pizza Away" (PDNTSPA)
2078 - Long Question 10 Marks
Differentiate between TCP and UDP protocols. When would you use each?
Detailed Answer:
Feature TCP UDP
Connection Connection-oriented (three-way handshake) Connectionless (no handshake)
Reliability Reliable - guarantees delivery with ACKs Unreliable - no guarantee of delivery
Ordering In-order delivery guaranteed No ordering guarantee
Header Size 20-60 bytes 8 bytes only
Speed Slower due to overhead Faster, minimal overhead
Flow Control Yes (sliding window) No
Error Checking Yes with retransmission Basic checksum only

When to use TCP: File transfer (FTP), Email (SMTP), Web browsing (HTTP), Database access - where reliability is critical.

When to use UDP: Video streaming, Online gaming, DNS queries, VoIP - where speed is more important than reliability.

2080 - Short Question 5 Marks
Given the network 192.168.10.0/24, create 4 subnets and show the network address, broadcast address, and usable IP range for each subnet.
Detailed Answer:

Given: 192.168.10.0/24 (Class C network)

Requirement: 4 subnets

Step 1: Calculate bits to borrow

2โฟ โ‰ฅ 4, so n = 2 bits

Step 2: New subnet mask

/24 + 2 = /26 (255.255.255.192)

Step 3: Calculate block size

256 - 192 = 64

Step 4: Determine subnets

Subnet Network Address Usable Range Broadcast
1 192.168.10.0/26 192.168.10.1 - 192.168.10.62 192.168.10.63
2 192.168.10.64/26 192.168.10.65 - 192.168.10.126 192.168.10.127
3 192.168.10.128/26 192.168.10.129 - 192.168.10.190 192.168.10.191
4 192.168.10.192/26 192.168.10.193 - 192.168.10.254 192.168.10.255

Hosts per subnet: 2โถ - 2 = 62 usable hosts

2079 - Long Question 10 Marks
Compare distance vector and link state routing algorithms. Explain Dijkstra's algorithm with an example.
Detailed Answer:
Aspect Distance Vector (RIP) Link State (OSPF)
Algorithm Bellman-Ford Dijkstra
Information Shared Entire routing table with neighbors Link state information with all routers
Convergence Speed Slow Fast
Metric Hop count (max 15) Cost (bandwidth-based)
Memory Usage Less More
CPU Usage Less More
Scalability Small networks Large networks

Dijkstra's Algorithm Example:

Find shortest path from A to all nodes:

    A---4---B
    |       |\
    2       1  3
    |       |   \
    C---3---D----E

Steps:

  1. Initialize: A=0, B=โˆž, C=โˆž, D=โˆž, E=โˆž
  2. Visit A: Update B=4, C=2
  3. Visit C (smallest): Update D=5 (2+3)
  4. Visit B: Update D=5 (min(5, 4+1)), E=7 (4+3)
  5. Visit D: Update E=6 (5+1)
  6. Visit E: Done

Final shortest paths from A: A=0, C=2, B=4, D=5, E=6

2078 - Short Question 5 Marks
What is NAT? Explain its types and why it is needed.
Detailed Answer:

NAT (Network Address Translation): A method of remapping one IP address space into another by modifying network address information in the IP header of packets.

Why NAT is needed:

  • IPv4 Address Shortage: Limited public IP addresses available
  • Security: Hides internal network structure from external view
  • Flexibility: Easy to change ISPs without renumbering internal network
  • Cost Saving: Multiple devices can share single public IP

Types of NAT:

  1. Static NAT: One-to-one mapping between private and public IP. Used for servers that need to be accessible from outside.
  2. Dynamic NAT: Maps private IP to public IP from a pool of available addresses. One-to-one but dynamic assignment.
  3. PAT/NAPT (Port Address Translation): Many-to-one mapping using different port numbers. Most common type used in home routers.

Old questions are included in the Notes tab above.

โš™๏ธ ICT.Ed 457: Software Engineering and Project Management

Learn software development processes, requirements engineering, design patterns, testing strategies, and project management techniques.

๐Ÿ“š Notes
โ“ MCQs
๐Ÿ“‹ Old Questions
โšก Mini Quiz
1 Introduction to Software Engineering (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

1.1 Software Engineering Definition

Definition (IEEE): Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software.

Key Aspects:

  • Systematic: Follows defined processes and methodologies
  • Disciplined: Adheres to standards and best practices
  • Quantifiable: Measurable and trackable
1.2 Software Crisis

The software crisis (1960s) refers to problems in software development:

  • Projects running over budget and time
  • Software with poor quality and many bugs
  • Software not meeting requirements
  • Difficult to maintain and modify

Solution: Software Engineering principles and practices

1.3 Attributes of Good Software
Attribute Description
Maintainability Should be easy to modify and evolve to meet changing needs
Dependability Should be reliable, secure, and safe
Efficiency Should make efficient use of system resources
Usability Should be easy to learn and use
Remember MDEU: Maintainability, Dependability, Efficiency, Usability
1.4 Software Process Models
Model Characteristics Best For Limitations
Waterfall Sequential phases, no overlap Clear, stable requirements Inflexible, late feedback
Incremental System built in increments Early delivery needed Requires good planning
Spiral Risk-driven, iterative Large, complex projects Complex, expensive
Agile Iterative, flexible, customer-focused Changing requirements Less documentation
Exam Tip: Waterfall is best when requirements are clear. Agile is best when requirements change frequently.
2 Software Processes and Agile Development (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

2.1 Agile Manifesto (2001)

Four core values:

  1. Individuals and interactions over processes and tools
  2. Working software over comprehensive documentation
  3. Customer collaboration over contract negotiation
  4. Responding to change over following a plan
Remember IWC-R: Individuals, Working software, Customer collaboration, Responding to change

12 Agile Principles:

  1. Customer satisfaction through early delivery
  2. Welcome changing requirements
  3. Deliver working software frequently
  4. Business people and developers work together
  5. Build projects around motivated individuals
  6. Face-to-face conversation is best
  7. Working software is primary measure of progress
  8. Sustainable development pace
  9. Continuous attention to technical excellence
  10. Simplicity - maximize work not done
  11. Self-organizing teams
  12. Regular reflection and adjustment
2.2 Scrum Framework

Roles:

  • Product Owner: Defines product backlog, prioritizes features
  • Scrum Master: Facilitates process, removes obstacles
  • Development Team: Self-organizing team that builds product

Artifacts:

  • Product Backlog: Prioritized list of all desired features
  • Sprint Backlog: Items selected for current sprint
  • Increment: Potentially shippable product at sprint end

Events:

  • Sprint: Time-boxed iteration (1-4 weeks)
  • Sprint Planning: Plan work for upcoming sprint
  • Daily Scrum: 15-minute daily standup meeting
  • Sprint Review: Demo completed work to stakeholders
  • Sprint Retrospective: Team reflects on process
2.3 Verification vs Validation
Aspect Verification Validation
Question Are we building the product RIGHT? Are we building the RIGHT product?
Focus Conformance to specifications Meeting user needs
Activities Reviews, inspections, walkthroughs Testing with users
When Throughout development After development
3 Requirements Engineering (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

3.1 Types of Requirements

Functional Requirements: What the system should do

  • User login functionality
  • Generate reports
  • Process payments

Non-Functional Requirements: How the system should perform

  • Performance: Response time, throughput
  • Security: Authentication, encryption
  • Reliability: Availability, fault tolerance
  • Usability: Ease of use, learnability
  • Scalability: Handle growing users/data
3.2 SRS (Software Requirements Specification)

Document that describes what the software will do and how it will be expected to perform.

Characteristics of good SRS (IEEE 830):

  • Correct: Every requirement is correct
  • Unambiguous: Only one interpretation
  • Complete: All requirements included
  • Consistent: No conflicts between requirements
  • Verifiable: Can be tested
  • Modifiable: Easy to change
  • Traceable: Origin of each requirement known
Remember CUCCVMT: Correct, Unambiguous, Complete, Consistent, Verifiable, Modifiable, Traceable
3.3 Requirements Elicitation Techniques
Technique Description Best For
Interviews One-on-one discussions with stakeholders Understanding individual perspectives
Questionnaires Written set of questions Large number of stakeholders
Observation Watch users perform tasks Understanding actual work processes
Prototyping Create mockups for feedback Clarifying user interface needs
Brainstorming Group idea generation Exploring innovative solutions
4 Software Design and Testing (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

4.1 Software Design Principles

Cohesion: Measure of how closely related elements within a module are

  • High cohesion is desirable (module does one thing well)
  • Types: Functional, Sequential, Communicational, Procedural, Temporal, Logical, Coincidental

Coupling: Measure of interdependence between modules

  • Low coupling is desirable (modules are independent)
  • Types: Data, Stamp, Control, External, Common, Content
Remember: High Cohesion + Low Coupling = Good Design
4.2 Design Patterns
Pattern Type Purpose
Singleton Creational Ensure only one instance of a class
Factory Creational Create objects without specifying exact class
Observer Behavioral One-to-many dependency notification
Strategy Behavioral Define family of interchangeable algorithms
MVC Architectural Separate Model, View, Controller
4.3 Software Testing Levels
Level What is Tested Who Tests Focus
Unit Testing Individual modules/functions Developers Code correctness
Integration Testing Combined modules Developers/Testers Interface defects
System Testing Complete system Testers Requirements compliance
Acceptance Testing System with real data Users/Clients Business needs
4.4 Types of Testing

Black Box Testing: Test without knowing internal code structure

  • Equivalence Partitioning
  • Boundary Value Analysis
  • Decision Table Testing

White Box Testing: Test with knowledge of internal code

  • Statement Coverage
  • Branch Coverage
  • Path Coverage

Other Testing Types:

  • Regression Testing: Ensure changes don't break existing functionality
  • Performance Testing: Load, stress, scalability testing
  • Security Testing: Identify vulnerabilities
  • Usability Testing: Ease of use evaluation
4.5 Cyclomatic Complexity

Measures the complexity of a program by counting independent paths.

Formula: V(G) = E - N + 2P

  • E = Number of edges
  • N = Number of nodes
  • P = Number of connected components (usually 1)

Alternative: V(G) = Number of predicate nodes + 1

Interpretation:

  • 1-10: Simple, low risk
  • 11-20: Moderate risk
  • 21-50: High risk
  • 50+: Very high risk, needs refactoring
5 Project Management (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

5.1 Project Management Concepts

Project: Temporary endeavor with defined beginning and end, creating unique product/service

Triple Constraint (Iron Triangle):

  • Scope: What needs to be done
  • Time: Schedule/deadlines
  • Cost: Budget/resources

Changes to one constraint affect the others.

5.2 Project Scheduling

Work Breakdown Structure (WBS): Hierarchical decomposition of project into manageable components

CPM (Critical Path Method):

  • Identifies the longest path through project network
  • Determines minimum project duration
  • Activities on critical path have zero slack

PERT (Program Evaluation and Review Technique):

  • Uses three time estimates: Optimistic (O), Most Likely (M), Pessimistic (P)
  • Expected Time: Te = (O + 4M + P) / 6
5.3 Software Metrics
Metric Description Use
LOC (Lines of Code) Count of code lines Size estimation
Function Points Measure functionality based on inputs, outputs, files Size/effort estimation
Cyclomatic Complexity Measure of code complexity Test planning
Defect Density Defects per unit size Quality measurement
5.4 Risk Management

Risk Management Process:

  1. Identification: Find potential risks
  2. Analysis: Assess probability and impact
  3. Planning: Develop response strategies
  4. Monitoring: Track and control risks

Risk Response Strategies:

  • Avoid: Eliminate the risk
  • Mitigate: Reduce probability or impact
  • Transfer: Shift to third party (insurance)
  • Accept: Acknowledge and monitor

๐Ÿ“‹ Old Questions with Answers

2079 - Short Question 5 Marks
Differentiate between verification and validation with examples.
Detailed Answer:
Aspect Verification Validation
Question Are we building the product RIGHT? Are we building the RIGHT product?
Focus Conformance to specifications Meeting user needs
Activities Reviews, inspections, walkthroughs, static analysis Testing with actual users, acceptance testing
When Throughout development (before coding) After development (with executable)
Example Reviewing SRS document for completeness User testing if software meets business needs

Key Difference: Verification ensures the product is built according to specifications. Validation ensures the right product is built for the user's needs.

2078 - Long Question 10 Marks
Explain the Agile Manifesto and its principles. Compare Agile with Waterfall model.
Detailed Answer:

Agile Manifesto (2001) - Four Values:

  1. Individuals and interactions over processes and tools
  2. Working software over comprehensive documentation
  3. Customer collaboration over contract negotiation
  4. Responding to change over following a plan

Note: While there is value in items on the right, Agile values items on the left more.

12 Agile Principles:

  1. Customer satisfaction through early and continuous delivery
  2. Welcome changing requirements, even late in development
  3. Deliver working software frequently (weeks rather than months)
  4. Business people and developers must work together daily
  5. Build projects around motivated individuals
  6. Face-to-face conversation is most efficient
  7. Working software is the primary measure of progress
  8. Maintain a constant sustainable pace of development
  9. Continuous attention to technical excellence
  10. Simplicity - maximize work not done
  11. Best architectures emerge from self-organizing teams
  12. Regular reflection and adjustment

Agile vs Waterfall Comparison:

Aspect Agile Waterfall
Approach Iterative and incremental Sequential phases
Requirements Can change throughout Fixed at beginning
Delivery Continuous/frequent At the end
Customer involvement High throughout Mainly at start and end
Documentation Lightweight Comprehensive
Best for Changing requirements Clear, stable requirements
2080 - Short Question 5 Marks
What is cyclomatic complexity? Calculate it for a given flow graph.
Detailed Answer:

Cyclomatic Complexity: A software metric developed by Thomas McCabe to measure the complexity of a program. It quantifies the number of linearly independent paths through the program's source code.

Formulas:

  • V(G) = E - N + 2P (E=edges, N=nodes, P=connected components)
  • V(G) = Number of predicate nodes (decision points) + 1
  • V(G) = Number of regions in flow graph

Example Calculation:

    [Start]
       |
       v
    [Input A,B]
       |
       v
    [If A>B] ----No----> [Print B]
       | Yes                |
       v                    |
    [Print A] <-------------|
       |
       v
    [End]

Nodes (N): 6 (Start, Input, If, Print A, Print B, End)

Edges (E): 7

Cyclomatic Complexity: V(G) = E - N + 2 = 7 - 6 + 2 = 3

Interpretation:

  • 1-10: Simple, low risk
  • 11-20: Moderate risk
  • 21-50: High risk
  • 50+: Very high risk, needs refactoring
2078 - Short Question 5 Marks
Explain black-box and white-box testing with examples.
Detailed Answer:

Black-Box Testing (Functional Testing):

Testing without knowledge of internal code structure. Focus on inputs and expected outputs.

  • Techniques:
    • Equivalence Partitioning: Divide inputs into valid/invalid classes
    • Boundary Value Analysis: Test at boundaries (min, min+1, max-1, max)
    • Decision Table Testing: Test combinations of conditions
  • Example: Testing login with valid/invalid username/password combinations without seeing the code

White-Box Testing (Structural Testing):

Testing with knowledge of internal code structure. Focus on code coverage.

  • Techniques:
    • Statement Coverage: Execute every statement at least once
    • Branch Coverage: Execute every branch (true/false) at least once
    • Path Coverage: Execute all possible paths through code
  • Example: Writing tests to ensure all if-else branches are executed
Aspect Black-Box White-Box
Knowledge Required None of internal code Full knowledge of code
Focus Functionality Code structure
Who Performs Testers, QA Developers
Also Called Functional, Behavioral Structural, Glass-box
2079 - Long Question 10 Marks
Explain the Scrum framework including roles, artifacts, and events.
Detailed Answer:

Scrum Roles:

  1. Product Owner:
    • Defines and prioritizes product backlog
    • Represents stakeholders and customers
    • Accepts or rejects work results
  2. Scrum Master:
    • Facilitates Scrum process
    • Removes impediments for the team
    • Coaches team on Agile practices
  3. Development Team:
    • Self-organizing, cross-functional team
    • Typically 3-9 members
    • Responsible for delivering potentially shippable increment

Scrum Artifacts:

  1. Product Backlog: Prioritized list of all features, requirements, and fixes
  2. Sprint Backlog: Items selected from product backlog for current sprint plus plan to deliver
  3. Increment: Sum of all product backlog items completed during sprint, must be usable

Scrum Events:

  1. Sprint: Time-boxed iteration (1-4 weeks, typically 2 weeks)
  2. Sprint Planning: Plan work for upcoming sprint (max 8 hours for 4-week sprint)
  3. Daily Scrum: 15-minute daily standup meeting for synchronization
  4. Sprint Review: Demo completed work to stakeholders at sprint end
  5. Sprint Retrospective: Team reflects on process and identifies improvements

Old questions are included in the Notes tab above.

๐Ÿ”ข Math.Ed 456: Discrete Mathematics

Master logic, set theory, relations, functions, combinatorics, graph theory, Boolean algebra, and cryptography.

๐Ÿ“š Notes
โ“ MCQs
๐Ÿ“‹ Old Questions
โšก Mini Quiz
1 Logic and Proofs (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

1.1 Propositional Logic

Logical Connectives:

Connective Symbol Meaning Truth Table
Negation ยฌ or ~ NOT ยฌT=F, ยฌF=T
Conjunction โˆง AND TโˆงT=T, else F
Disjunction โˆจ OR FโˆจF=F, else T
Implication โ†’ If...then Fโ†’T=T, Fโ†’F=T, Tโ†’F=F, Tโ†’T=T
Biconditional โ†” If and only if Tโ†”T=T, Fโ†”F=T, else F
1.2 Logical Equivalences
Name Equivalence
Identity p โˆง T โ‰ก p, p โˆจ F โ‰ก p
Domination p โˆจ T โ‰ก T, p โˆง F โ‰ก F
Idempotent p โˆจ p โ‰ก p, p โˆง p โ‰ก p
Double Negation ยฌ(ยฌp) โ‰ก p
Commutative p โˆจ q โ‰ก q โˆจ p, p โˆง q โ‰ก q โˆง p
Associative (p โˆจ q) โˆจ r โ‰ก p โˆจ (q โˆจ r)
Distributive p โˆจ (q โˆง r) โ‰ก (p โˆจ q) โˆง (p โˆจ r)
De Morgan's ยฌ(p โˆง q) โ‰ก ยฌp โˆจ ยฌq, ยฌ(p โˆจ q) โ‰ก ยฌp โˆง ยฌq
De Morgan's Law: "Break the line, change the sign" - NOT of AND becomes OR of NOTs
1.3 Rules of Inference
Rule Form Name
Modus Ponens p โ†’ q, p โˆด q Affirming the antecedent
Modus Tollens p โ†’ q, ยฌq โˆด ยฌp Denying the consequent
Hypothetical Syllogism p โ†’ q, q โ†’ r โˆด p โ†’ r Chain rule
Disjunctive Syllogism p โˆจ q, ยฌp โˆด q Process of elimination
1.4 Types of Proofs
  • Direct Proof: Assume p is true, prove q is true
  • Proof by Contrapositive: Prove ยฌq โ†’ ยฌp instead of p โ†’ q
  • Proof by Contradiction: Assume statement is false, derive contradiction
  • Proof by Induction: Base case + Inductive step
2 Sets, Relations and Functions (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

2.1 Set Operations
Operation Symbol Definition
Union A โˆช B {x | x โˆˆ A or x โˆˆ B}
Intersection A โˆฉ B {x | x โˆˆ A and x โˆˆ B}
Difference A - B {x | x โˆˆ A and x โˆ‰ B}
Complement A' {x | x โˆ‰ A}
Cartesian Product A ร— B {(a,b) | a โˆˆ A, b โˆˆ B}
2.2 Relations

Properties of Relations:

  • Reflexive: (a,a) โˆˆ R for all a โˆˆ A
  • Symmetric: If (a,b) โˆˆ R then (b,a) โˆˆ R
  • Transitive: If (a,b) โˆˆ R and (b,c) โˆˆ R then (a,c) โˆˆ R
  • Antisymmetric: If (a,b) โˆˆ R and (b,a) โˆˆ R then a = b

Types of Relations:

  • Equivalence Relation: Reflexive, Symmetric, Transitive
  • Partial Order: Reflexive, Antisymmetric, Transitive
2.3 Functions

Types of Functions:

  • Injective (One-to-One): f(a) = f(b) implies a = b
  • Surjective (Onto): Every element in codomain is mapped
  • Bijective: Both injective and surjective
Remember: Injective = One-to-One, Surjective = Onto, Bijective = Both
3 Combinatorics (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

3.1 Counting Principles

Sum Rule: If task A can be done in m ways and task B in n ways (mutually exclusive), then A or B can be done in m + n ways.

Product Rule: If task A can be done in m ways and task B in n ways, then A and B can be done in m ร— n ways.

3.2 Permutations

Permutation (order matters):

  • P(n,r) = n!/(n-r)! = n ร— (n-1) ร— ... ร— (n-r+1)
  • Arranging r items from n items

Example: How many ways to arrange 3 people from 5?

P(5,3) = 5!/(5-3)! = 5!/2! = 120/2 = 60 ways

3.3 Combinations

Combination (order doesn't matter):

  • C(n,r) = n!/(r!(n-r)!)
  • Selecting r items from n items

Example: How many ways to choose 3 people from 5?

C(5,3) = 5!/(3!ร—2!) = 120/(6ร—2) = 10 ways

Remember: Permutation = Order matters (arrangement). Combination = Order doesn't matter (selection).
3.4 Pigeonhole Principle

Basic Form: If n items are put into m containers with n > m, then at least one container must contain more than one item.

Generalized Form: If n items into m containers, at least one container has โŒˆn/mโŒ‰ items.

Example: In a group of 13 people, at least 2 have birthday in same month (13 > 12).

3.5 Binomial Theorem

(a + b)โฟ = ฮฃ C(n,k) ร— aโฟโปแต ร— bแต for k = 0 to n

Example: (a + b)ยณ = C(3,0)aยณ + C(3,1)aยฒb + C(3,2)abยฒ + C(3,3)bยณ = aยณ + 3aยฒb + 3abยฒ + bยณ

4 Graph Theory (9 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

4.1 Graph Basics

Graph G = (V, E) where V is set of vertices and E is set of edges.

Types of Graphs:

Type Description
Simple Graph No loops, no multiple edges
Multigraph Multiple edges allowed
Directed Graph Edges have direction
Weighted Graph Edges have weights/costs
Complete Graph (Kโ‚™) Every vertex connected to every other
Bipartite Graph Vertices divided into two sets, edges only between sets
4.2 Graph Terminology
  • Degree of vertex: Number of edges incident to it
  • Path: Sequence of vertices connected by edges
  • Cycle: Path that starts and ends at same vertex
  • Connected Graph: Path exists between any two vertices
  • Tree: Connected graph with no cycles
4.3 Euler and Hamiltonian Paths
  • Euler Path: Path that uses every edge exactly once. Exists if 0 or 2 vertices have odd degree.
  • Euler Circuit: Euler path that starts and ends at same vertex. Exists if all vertices have even degree.
  • Hamiltonian Path: Path that visits every vertex exactly once.
  • Hamiltonian Circuit: Hamiltonian path that starts and ends at same vertex.
4.4 Euler's Formula for Planar Graphs

For any connected planar graph: V - E + F = 2

  • V = Number of vertices
  • E = Number of edges
  • F = Number of faces (including outer face)
Remember: V - E + F = 2 (Vertices - Edges + Faces = 2)
4.5 Trees

Properties of Trees:

  • Connected graph with no cycles
  • For n vertices, tree has exactly n-1 edges
  • Exactly one path between any two vertices

Spanning Tree: Subgraph that is a tree containing all vertices of original graph.

5 Boolean Algebra and Cryptography (6 hrs)
โ–ผ

๐Ÿ“– Detailed Notes

5.1 Boolean Algebra

Algebraic structure with two values: 0 (False) and 1 (True)

Basic Operations:

Operation Symbol Logic Gate
AND ยท or โˆง Output 1 only if all inputs 1
OR + or โˆจ Output 1 if any input 1
NOT ' or ยฌ Inverts input
XOR โŠ• Output 1 if inputs differ

Boolean Laws:

  • Idempotent: A + A = A, A ยท A = A
  • Complement: A + A' = 1, A ยท A' = 0
  • Commutative: A + B = B + A, A ยท B = B ยท A
  • Associative: (A + B) + C = A + (B + C)
  • Distributive: A ยท (B + C) = AยทB + AยทC
  • De Morgan's: (A + B)' = A' ยท B', (A ยท B)' = A' + B'
5.2 Karnaugh Maps (K-Maps)

Visual method for simplifying Boolean expressions.

Steps to Simplify:

  1. Draw K-map based on number of variables
  2. Fill 1s for minterms in function
  3. Group adjacent 1s in powers of 2 (1, 2, 4, 8...)
  4. Make groups as large as possible
  5. Write simplified expression from groups
5.3 Cryptography Basics

Caesar Cipher: Shift each letter by fixed number

  • Encryption: E(x) = (x + k) mod 26
  • Decryption: D(x) = (x - k) mod 26

RSA Algorithm:

  1. Choose two prime numbers p and q
  2. Calculate n = p ร— q
  3. Calculate ฯ†(n) = (p-1) ร— (q-1)
  4. Choose e such that 1 < e < ฯ†(n) and gcd(e, ฯ†(n)) = 1
  5. Calculate d such that e ร— d โ‰ก 1 (mod ฯ†(n))
  6. Public Key: (e, n), Private Key: (d, n)

Encryption: C = Mแต‰ mod n

Decryption: M = Cแตˆ mod n

๐Ÿ“‹ Old Questions with Answers

2079 - Short Question 5 Marks
State and prove De Morgan's Laws.
Detailed Answer:

De Morgan's Laws:

  1. ยฌ(A โˆง B) โ‰ก ยฌA โˆจ ยฌB (NOT of AND is OR of NOTs)
  2. ยฌ(A โˆจ B) โ‰ก ยฌA โˆง ยฌB (NOT of OR is AND of NOTs)

Proof using Truth Table for Law 1:

A B A โˆง B ยฌ(A โˆง B) ยฌA ยฌB ยฌA โˆจ ยฌB
TTTFFFF
TFFTFTT
FTFTTFT
FFFTTTT

Since columns ยฌ(A โˆง B) and ยฌA โˆจ ยฌB are identical, the law is proved.

Remember: "Break the line, change the sign" - When you apply NOT to AND, it becomes OR, and vice versa.
2078 - Long Question 10 Marks
In how many ways can 5 people be seated in a row? In how many ways if two particular people must sit together?
Detailed Answer:

Part 1: Total arrangements of 5 people

Number of ways = 5! = 5 ร— 4 ร— 3 ร— 2 ร— 1 = 120 ways

Part 2: When 2 particular people must sit together

Step 1: Treat the 2 people as one unit. Now we have 4 units to arrange (the pair + 3 individuals).

Step 2: Number of ways to arrange 4 units = 4! = 24

Step 3: The 2 people within the pair can arrange themselves in 2! = 2 ways

Step 4: Total ways = 4! ร— 2! = 24 ร— 2 = 48 ways

Formula: When k items must be together, arrangements = (n-k+1)! ร— k!

2080 - Short Question 5 Marks
Simplify the Boolean expression F = A'B'C + A'BC + AB'C + ABC using K-map.
Detailed Answer:

Given: F = A'B'C + A'BC + AB'C + ABC

K-map (3 variables - A, B, C):

        BC
      00  01  11  10
A  0 | 0 | 1 | 1 | 0 |
   1 | 0 | 1 | 1 | 0 |

Grouping:

Group 1: A'BC + ABC = BC(A' + A) = BC

Group 2: A'B'C + AB'C = B'C(A' + A) = B'C

Simplified Expression: F = BC + B'C = C(B + B') = C

Verification: When C=1, F=1 regardless of A and B. When C=0, F=0. This confirms F = C.

2078 - Long Question 10 Marks
Explain Euler's formula for planar graphs with proof. Verify for a cube.
Detailed Answer:

Euler's Formula: For any connected planar graph, V - E + F = 2

  • V = Number of vertices
  • E = Number of edges
  • F = Number of faces (including outer face)

Proof by Induction on Number of Edges:

Base Case: Tree with n vertices has n-1 edges and 1 face (outer)

V - E + F = n - (n-1) + 1 = 2 โœ“

Inductive Step: Assume true for graph with k edges. Add one edge:

  • If connects two existing vertices: creates new face
  • V unchanged, E increases by 1, F increases by 1
  • V - (E+1) + (F+1) = V - E + F = 2 โœ“

Verification for Cube:

  • Vertices (V) = 8 (corners)
  • Edges (E) = 12
  • Faces (F) = 6 (including outer face)

V - E + F = 8 - 12 + 6 = 2 โœ“

2079 - Short Question 5 Marks
Explain the RSA algorithm with a numerical example.
Detailed Answer:

RSA Algorithm Steps:

1. Key Generation:

  • Choose two primes: p = 3, q = 11
  • Calculate n = p ร— q = 33
  • Calculate ฯ†(n) = (p-1)(q-1) = 2 ร— 10 = 20
  • Choose e such that 1 < e < ฯ†(n) and gcd(e, ฯ†(n)) = 1: e = 3
  • Calculate d such that e ร— d โ‰ก 1 (mod ฯ†(n)): 3 ร— 7 = 21 โ‰ก 1 (mod 20), so d = 7
  • Public Key: (e, n) = (3, 33)
  • Private Key: (d, n) = (7, 33)

2. Encryption:

Message m = 5

Ciphertext c = mแต‰ mod n = 5ยณ mod 33 = 125 mod 33 = 26

3. Decryption:

Message m = cแตˆ mod n = 26โท mod 33 = 5 (original message)

Why RSA is Secure:

  • Security based on difficulty of factoring large numbers
  • For large primes (1024+ bits), factoring n is computationally infeasible
  • Private key cannot be derived from public key without knowing p and q

Old questions are included in the Notes tab above.

๐ŸŽฏ Weak Topics Tracker

Track and focus on topics that need more practice.

Your Weak Topics

No weak topics marked yet. Go to any subject and click "Add to Weak Topics" to track areas you need to review.

๐Ÿ”– Bookmarks

Quick access to your saved important topics.

Your Bookmarks

No bookmarks yet. Use the bookmark feature on topics to save them here.

๐Ÿ† Badges & Achievements

Earn badges by studying consistently and completing quizzes!

Your Badges