M.C.A. Sem-2
Course Code: LMC0204 | Course Title: Advance Data Structures (3 Credits) |
Course Objectives: –
· Toprovideknowledgeofwaysofstructuringandoperatingondata,thenatureofsome fundamentalproblems,methodsfor addressingthoseproblems. · Topromote an analytical and empiricalappreciation ofthe behavior of algorithmsusingdata structures · To Understand the fundamental concepts of data structures. |
Course Contents
Unit | Unit Description | Learning Outcome |
1 | Analysis of Algorithm: Asymptotic analysis: Notations, methods to solve recurrences, Amortized Analysis: methods | This module has been designed as per BTL 1 & 4. |
2 | Linked List: implementation of singly and doubly linked List (Algorithm & Program), comparison of both types of Linked List. | This module has been designed as per BTL 3 & 6. |
3 | Circular Linked List and Sparse Matrix: Implementation of Circular Singly and Doubly Linked List, Array and Linked List representation of Sparse Matrix(Algorithm) | This module has been designed as per BTL 1 & 6. |
4 | stack and Queue: Array and Linked List implementation of stack and Queue, Postfix evaluation, Dynamic array-based implementation of stack, types of Queue. Implementation of Circular queue using array and Linked List. | This module has been designed as per BTL 1, 3 & 5. |
5 | Heap, Priority Queue and Deque: Heap Sort method, implementation of priority queue using array, linked list and heap, implementation of Deque using array and doubly linked list, applications of Deque. | This module has been designed as per BTL1, 3 & 5. |
6 | Sorting and Hashing: Bubble-sort, Counting Sort, Radix sort.
Hashing: Hash functions, Collision Resolution methods-Open Addressing, Chaining. |
This module has been designed as per BTL 1 & 2. |
7 | Java Data Structures: ArrayList, LinkedList, Vector classes, Stacks and Queues in java.util, Iterators in java.util, Hashing in java.util-HashMap, HashSet, Hashtable, Trees in java.util- TreeSet, Tree Map Classes, Tries(examples only),
|
This module has been designed as per BTL 2 & 3. |
8 | Algorithmic paradigms: Greedy Strategy, Dynamic programming, Backtracking, Branch-and-Bound, Randomized algorithms | This module has been designed as per BTL 1 & 3. |
9 | Text compression & Pattern matching: Huffman coding and decoding for text compression, KMP algorithm for pattern matching. | This module has been designed as per BTL 1 & 4. |
10 | Binary Search Tree: insertion, deletion, traversal and search operations on BST.(Algorithm), B-Trees-definition, insertion and searching operations. | This module has been designed as per BTL 1 & 3. |
11 | Balanced Search Tree: AVL tree-insertion, deletion, single rotation, double rotation.(definition & examples only), Red-Black Tree: insertion, deletion, single rotation, double rotation.(definition & examples only) Comparison of Search trees. | This module has been designed as per BTL 1 & 3. |
12 | Applications of Graphs: -Minimum cost spanning tree using Prim’s and Kruskal’s algorithm, Dijkstra’s algorithm for Single Source Shortest Path Problem, Maximum Flow: The Ford Fulkerson method | This module has been designed as per BTL 1. |
Textbook References: –
1. Data Structures and Algorithm Analysis in C++, Mark Allen Weiss, 4th Edition, 2014, Pearson. 2. Introduction to Algorithms, Thomas H Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, 3rd Edition, 2009, The MIT Press. 3. Advanced Data Structures, Reema Thareja, S. Rama Sree, Oxford University Press, 2018. Open Source References: – 1. https://nptel.ac.in/courses/106/106/106106133/ [2]. https://www.geeksforgeeks.org/advanced-data-structures/ |
(Bloom’s Taxonomy: BT level 1: Remembering; BT level 2: Understanding; BT level 3: Applying; BT level 4: Analyzing; BT level 5: Evaluating; BT level 6: Creating)
Syllabus
Program | MasterofComputerApplications |
Semester | II |
CourseTitle | Advance Data StructurePractical |
Course Code | LMC0222 |
CourseCredits | 02 |
Course Type | CorePractical Course |
- CourseSummary
This course provides hands-on experience with advanced data structures, focusing on their implementation and application in solving complex computational problems. The practical sessions are designed to reinforce theoretical knowledge through programming exercises and projects.
Key Objectives
- Understand and implement advanced data structures.
- Analyze the performance of various data structures.
- Apply data structures to solve real-world problems.
- Develop efficient algorithms using appropriate data structures.
- List of Experiments
#Expt.No. | ProblemDefinition |
1 | Write a program in java to represent a Sparse Matrix using Array. |
2 | Write a program in java to implement a doubly linked list. |
3 | Write a program in java to perform push and pop operations on a stack using array. |
4 | Write a program in java to implement heap sort method. |
5 | Write a program in java to implement bubble sort method. |
6 | Write a program in java to implement counting sort method. |
Table 1.1 List of experiments
- CourseResources
- EssentialReading
- CourseSelf-LearningMaterial.
- Cormen, Thomas H., Leiserson, Charles E., Rivest, Ronald L., Clifford Stein. Introduction to Algorithms. Cambridge, MA: The MIT Press, 2001.
- A Practical Introduction to Data Structures and Algorithm Analysis Author: Clifford A. Snaffer Third Edition (Java).
- RecommendedReading
- Das, Vinu V. Principles of data structures using C and C++. New Age International, 2006.
- Data Structures Through C (A practical Approach), Author: G.S. Baluja
- Principles of Data Structures using C and C++ Author: Vinu V Das New Age International Publishers
- Websites
- EssentialReading
- OtherElectronicResources
- CourseVideoLectureson LMS
Sample Programs
EXPERIMENT-1
Problem definition: Write a program in java to represent a Sparse Matrix using Array.
SourceProgram:
class SM
{
public static void main(String[] args)
{
int sparseMatrix[][]
= {
{0, 0, 3, 0, 4},
{0, 0, 5, 7, 0},
{0, 0, 0, 0, 0},
{0, 2, 6, 0, 0} };
int size = 0;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 5; j++)
{
if (sparseMatrix[i][j] != 0)
{
size++;
}
}
}
// number of columns in compactMatrix (size) must be
// equal to number of non – zero elements in
// sparseMatrix
int compactMatrix[][] = new int[3][size];
// Making of new matrix
int k = 0;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 5; j++)
{
if (sparseMatrix[i][j] != 0)
{
compactMatrix[0][k] = i;
compactMatrix[1][k] = j;
compactMatrix[2][k] = sparseMatrix[i][j];
k++;
}
}
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < size; j++)
{
System.out.printf(“%d “, compactMatrix[i][j]);
}
System.out.printf(“\n”);
}
}
}
Output
0 0 1 1 3 3
2 4 2 3 1 2
3 4 5 7 2 6
EXPERIMENT-2
Problem definition: Write a program in java to implement a doubly linked list.
SourceProgram:
import java.io.*;
class DLL {
// Declaring an empty doubly linked list
static node head = null;
static node tail = null;
static void insertAtBeginning(int data)
{
node temp = new node(data);
if (head == null) {
head = temp;
tail = temp;
}
else {
temp.next = head;
head.prev = temp;
head = temp;
}
}
static void insertAtEnd(int data)
{
node temp = new node(data);
if (tail == null) {
head = temp;
tail = temp;
}
else {
tail.next = temp;
temp.prev = tail;
tail = temp;
}
}
static void insertAtPosition(int data, int position)
{
node temp = new node(data);
if (position == 1) {
insertAtBeginning(data);
}
else {
node current = head;
int currPosition = 1;
while (current != null&& currPosition < position) { current = current.next; currPosition++; } if (current == null) { insertAtEnd(data); } else { temp.next = current; temp.prev = current.prev; current.prev.next = temp; current.prev = temp; } } } static void deleteAtBeginning() { if (head == null) { return; } if (head == tail) { head = null; tail = null; return; } node temp = head; head = head.next; head.prev = null; temp.next = null; } static void deleteAtEnd() { if (tail == null) { return; } if (head == tail) { head = null; tail = null; return; } node temp = tail; tail = tail.prev; tail.next = null; temp.prev = null; } static void deleteAtSpecificPosition(int pos) { if (head == null) { return; } if (pos == 1) { deleteAtBeginning(); return; } node current = head; int count = 1; while (current != null && count != pos) { current = current.next; count++; } if (current == null) { System.out.println(“Position wrong”); return; } if (current == tail) { deleteAtEnd(); return; } current.prev.next = current.next; current.next.prev = current.prev; current.prev = null; current.next = null; } static void display(node head) { node temp = head; while (temp != null) { System.out.print(temp.data + ” –> “);
temp = temp.next;
}
System.out.println(“NULL”);
}
// Drivers code
public static void main(String[] args)
{
insertAtEnd(1);
insertAtEnd(2);
insertAtEnd(3);
insertAtEnd(4);
insertAtEnd(5);
System.out.print(“After insertion at tail: “);
display(head);
System.out.print(“After insertion at head: “);
insertAtBeginning(0);
display(head);
insertAtPosition(6, 2);
System.out.print(
“After insertion at 2nd position: “);
display(head);
deleteAtBeginning();
System.out.print(
“After deletion at the beginning: “);
display(head);
deleteAtEnd();
System.out.print(“After deletion at the end: “);
display(head);
deleteAtSpecificPosition(2);
System.out.print(
“After deletion at 2nd position: “);
display(head);
}
}
class node {
node prev;
int data;
node next;
// A constructor is called here
node(int value)
{
// By default previous pointer is
// pointed to NULL
prev = null;
// Value is assigned to the data
data = value;
// By default next pointer is pointed
// to NULL
next = null;
}
}
Output
After insertion at tail: 1 –> 2 –> 3 –> 4 –> 5 –> NULL
After insertion at head: 0 –> 1 –> 2 –> 3 –> 4 –> 5 –> NULL
After insertion at 2nd position: 0 –> 6 –> 1 –> 2 –> 3 –> 4 –> 5 –> NULL
After deletion at the beginning: 6 –> 1 –> 2 –> 3 –> 4 –> 5 –> NULL
After deletion at the end: 6 –> 1 –> 2 –> 3 –> 4 –> NULL
After deletion at 2nd position: 6 –> 2 –> 3 –> 4 –> NULL
EXPERIMENT-3
Problem definition: Write a program in java to perform push and pop operations on a stack using array.
SourceProgram:
import java.util.Scanner;
class Stack
{
int top;
int maxsize = 10;
int[] arr = new int[maxsize];
boolean isEmpty()
{
return (top < 0);
}
Stack()
{
top = -1;
}
boolean push (Scanner sc)
{
if(top == maxsize-1)
{
System.out.println(“Overflow !!”);
return false;
}
else
{
System.out.println(“Enter Value”);
int val = sc.nextInt();
top++;
arr[top]=val;
System.out.println(“Item pushed”);
return true;
}
}
boolean pop ()
{
if (top == -1)
{
System.out.println(“Underflow !!”);
return false;
}
else
{
top –;
System.out.println(“Item popped”);
return true;
}
}
void display ()
{
System.out.println(“Printing stack elements …..”);
for(int i = top; i>=0;i–)
{
System.out.println(arr[i]);
}
}
}
public class Stack_Operations {
public static void main(String[] args) {
int choice=0;
Scanner sc = new Scanner(System.in);
Stack s = new Stack();
System.out.println(“Stack operations using array\n”);
System.out.println(“\n——————————-\n”);
while(choice != 4)
{
System.out.println(“\nChose any option\n”);
System.out.println(“\n1.Push\n2.Pop\n3.Show\n4.Exit”);
System.out.println(“\n Enter your choice \n”);
choice = sc.nextInt();
switch(choice)
{
case 1:
{
s.push(sc);
break;
}
case 2:
{
s.pop();
break;
}
case 3:
{
s.display();
break;
}
case 4:
{
System.out.println(“Exiting….”);
System.exit(0);
break;
}
default:
{
System.out.println(“Please Enter valid choice”);
}
};
}
}
}
Output
*********Stack operations using array*********
————————————————
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
2
Underflow !!
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
3
Printing stack elements …..
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
1
Enter Value
2
Item pushed
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
1
Enter Value
5
Item pushed
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
1
Enter Value
8
Item pushed
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
3
Printing stack elements …..
8
5
2
Chose one from the below options…
1.Push
2.Pop
3.Show
4.Exit
Enter your choice
4
EXPERIMENT-4
Problem definition: Write a program in java to implement heap sort method.
SourceProgram:
public class HeapSort {
public void sort(int arr[]) {
int n = arr.length;
// Build max heap
for (int i = n / 2 – 1; i >= 0; i–) {
heapify(arr, n, i);
}
// Heap sort
for (int i = n – 1; i >= 0; i–) {
int temp = arr[0];
arr[0] = arr[i];
arr[i] = temp;
// Heapify root element
heapify(arr, i, 0);
}
}
void heapify(int arr[], int n, int i) {
// Find largest among root, left child and right child
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < n && arr[l] > arr[largest])
largest = l;
if (r < n && arr[r] > arr[largest])
largest = r;
// Swap and continue heapifying if root is not largest
if (largest != i) {
int swap = arr[i];
arr[i] = arr[largest];
arr[largest] = swap;
heapify(arr, n, largest);
}
}
// Function to print an array
static void printArray(int arr[]) {
int n = arr.length;
for (int i = 0; i < n; ++i)
System.out.print(arr[i] + ” “);
System.out.println();
}
// Driver code
public static void main(String args[]) {
int arr[] = { 1, 12, 9, 5, 6, 10 };
HeapSort hs = new HeapSort();
hs.sort(arr);
System.out.println(“Sorted array is”);
printArray(arr);
}
}
Output
Sorted array is
1 5 6 9 10 12
EXPERIMENT-5
Problem definition: Write a program in java to implement bubble sort method.
SourceProgram:
import java.io.*;
import java.util.*;
public class BubbleSort {
public static void main(String args[]) {
int n = 5;
int[] arr = {67, 44, 82, 17, 20}; //initialize an array
System.out.print(“Array before Sorting: “);
for(int i = 0; i<n; i++)
System.out.print(arr[i] + ” “);
System.out.println();
for(int i = 0; i<n; i++) {
int swaps = 0; //flag to detect any swap is there or not
for(int j = 0; j<n-i-1; j++) { if(arr[j] > arr[j+1]) { //when the current item is bigger than next
int temp;
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
swaps = 1; //set swap flag
}
}
if(swaps == 0)
break;
}
System.out.print(“Array After Sorting: “);
for(int i = 0; i<n; i++)
System.out.print(arr[i] + ” “);
System.out.println();
}
}
Output
Array before Sorting: 67 44 82 17 20
Array After Sorting: 17 20 44 67 82
EXPERIMENT-6
Problem definition: Write a program in java to implement counting sort method.
SourceProgram:
import java.io.*;
public class counting_sort {
static void sort(int a[], int n) {
int i, j;
int output[] = new int[15];
int c[] = new int[100];
for (i = 0; i < 100; i++)
c[i] = 0;
for (j = 0; j < n; j++)
++c[a[j]];
for (i = 1; i <= 99; i++) c[i] += c[i-1]; for (j = n-1; j >= 0; j–) {
output[c[a[j]] – 1] = a[j];
–c[a[j]];
}
System.out.println(“\nAfter sorting array elements are: “);
for (i = 0; i < n; ++i)
System.out.print(output[i] + ” “);
}
public static void main(String args[]){
int a[] = {12, 32, 44, 8, 16};
int n = a.length;
System.out.println(“Before sorting array elements are: “);
for(int i = 0; i<n; i++){
System.out.print(a[i] + ” “);
}
// Function call
sort(a, n);
}
}
Output
Before sorting array elements are:
12 32 44 8 16
After sorting array elements are:
8 12 16 32 44
ExercisePrograms
#Expt.No. | Problem Definition |
1 | Write a program in java to represent a Sparse Matrix using Linked List. |
2 | Write a program in java to implement a Circular Doubly linked list. |
3 | Write a program in java to implement a Queue using array. |
4 | Write a program in java to search an element in a Singly Linked List having
minimum 10 elements using Linear Search method. |
5 | Write a program in java to implement Binary Search on an array of minimum 10
elements. |
6 | Write a program in java to implement Radix Sort method. |
Course Code: LMC0205 | Course Title:Data Warehousing and Mining (3 Credits) |
Course Objectives: –
Ø To understand the fundamental concepts and applications of data warehousing and mining. Ø To learn the different data types and their significance in data mining. Ø To master the techniques of data preprocessing, classification, prediction, and clustering. Ø To develop the ability to implement data mining algorithms and techniques. Ø To analyze the practical applications and tools currently available in the field of data mining. |
Course Contents
Unit. | Unit description | Learning Outcome | ||
1 | Motivation, Importance, Data Type for Data Mining: Relational Databases, Data Warehouses, Transactional Databases, Advanced Database Systems and Applications, Data Mining Functionalities | Students will be able to achieve BL 1 and 2 (Remembering and Understanding). | ||
2 | Concept/Class Description, Association Analysis Classification & Prediction, Cluster Analysis, Outlier Analysis, Evolution Analysis, Classification of Data Mining Systems | Students will be able to achieve BL 2 and 3 (Understanding and Applying). | ||
3 | Data Warehouse and OLAP Technology for Data Mining: Differences between Operational Database Systems and Data Warehouses | Students will be able to achieve BL 2 and 3 (Understanding and Applying). | ||
4 | : Multidimensional Data Model, Data Warehouse Architecture, Data Warehouse Implementation, Data Cube Technology | Students will be able to achieve BL 3 and 4 (Applying and Analyzing). | ||
5 | : Data Preprocessing: Data Cleaning, Data Integration and Transformation, Data Reduction, Discretization and Concept Hierarchy Generation | Students will be able to achieve BL 3 and 4 (Applying and Analyzing). | ||
6 | Data Mining Primitives, Languages, and System Architectures, Concept Description: Characterization and Comparison, Analytical Characterization | Students will be able to achieve BL 2, 3, and 4 (Understanding, Applying, and Analyzing). | ||
7 | Mining Association Rules in Large Databases: Association Rule Mining: Market Basket Analysis, Basic Concepts | Students will be able to achieve BL 2 and 3 (Understanding and Applying). | ||
8 | Mining Single-Dimensional Boolean Association Rules from Transactional Databases: The Apriori Algorithm, Generating Association Rules from Frequent Items, Improving the Efficiency of Apriori | Students will be able to achieve BL 3 and 4 (Applying and Analyzing). | ||
9 | Mining Multilevel Association Rules, Multidimensional Association Rules, Constraint-Based Association Mining | Students will be able to achieve BL 3 and 4 (Applying and Analyzing). | ||
10 | Classification & Prediction and Cluster Analysis: Issues Regarding Classification & Prediction, Different Classification Methods, Prediction | Students will be able to achieve BL 4 and 5 (Analyzing and Evaluating). | ||
11 | Cluster Analysis, Major Clustering Methods, Applications & Trends in Data Mining | Students will be able to achieve BL 4 and 5 (Analyzing and Evaluating). | ||
12 | : Data Mining Applications, Currently Available Tools | Students will be able to achieve BL 5 and 6 (Evaluating and Creating). | ||
Textbook References: 1. J. Han and M. Kamber, “Data Mining: Concepts and Techniques”, Morgan Kaufmann Pub. 2. Berson, “Datawarehousing, Data Mining & OLAP”, TMH. 3. W.H. Inmon, “Building the Data Warehouse”, 3rd Ed, Wiley India. 4. Anahory, “Data Warehousing in Real World”, Pearson Education. 5. Adriaans, “Data Mining”, Pearson Education. 6. S.K. Pujari, “Data Mining Techniques”, University Press, Hyderabad. Other References: 7. Relevant online resources and current articles in the field of data warehousing and mining.
|
||||
(Bloom’s Taxonomy: BT level 1: Remembering; BT level 2: Understanding; BT level 3: Applying; BT level 4: Analyzing; BT level 5: Evaluating; BT level 6: Creating)
Course Code: LMC0202 | Course Title: Java Programming (3 Credits) |
Course Objectives: –
Ø To introduce the object-oriented programming concepts. Ø To understand object-oriented programming concepts, and apply them in solving problems. Ø To introduce the principles of inheritance and polymorphism; and demonstrate how they relate to the design of abstract classes Ø To introduce the implementation of packages and interfaces Ø Introduce the concepts of exception handling and multithreading. Ø To introduce the design of Graphical User Interface using applets and swing controls. |
Course Contents
Unit | Unit description | Learning Outcome |
1 | Overview of Object-Oriented Programming and Java: object-oriented paradigm, basic concept of OOP, benefits of OOP, application of OOP. | This module has been designed as per BTL 1 & 2. |
2 | Java Fundamentals: Token in java, JDK, Java virtual machine, JRE, Reflection byte codes, Byte code interpretation, Data types, variable, arrays, expressions, operators, and control structures, Objects and classes | This module has been designed as per BTL 3&5. |
3 | Java Classes: Abstract classes, Static classes, Inner classes, Packages, Wrapper classes, Interfaces, This, Super, Access control, constructor overloading, , static keyword, finalize () method in java. | This module has been designed as per BTL 3&4. |
4 | Decision making and loops: if statement, if else statement, nested if statement, switch case, while, do while, for, for each loop in java, | This module has been designed as per BTL 3 & 6. |
5 | Inheritance: Inheritance in java, aggregation, instance initializer block, static block, final keyword, garbage collection in java. | This module has been designed as per BTL 3 & 6. |
6 | Exception Handling: Exception as objects, Exception hierarchy, Try catch finally, Throw, throws, Multiple catch block in java, nested try block in java. | This module has been designed as per BTL 3 &6. |
7 | Multithreaded Programming: Thread Life cycle, Multithreading advantages and issues, Simple thread program, Thread synchronization. | This module has been designed as per BTL 3. |
8 | Java Applets and Servlets: Applet Introduction, applet class and its skeleton, graphics in applet, displaying image in applet. | This module has been designed as per BTL 3&4. |
9 | Java Swing and Abstract Windowing Toolkit (AWT): Layout and component managers, Event handling, Applet class, Applet life-cycle, Passing parameters embedding in HTML, Swing components – JApplet, JButton, JFrame, etc. Sample swing programs | This module has been designed as per BTL 3&4. |
10 | IO package: Input streams, Output streams, Object serialization, Deserialization, Sample programs on IO files, Filter and pipe streams. | This module has been designed as per BTL 4&5. |
11 | Database Connectivity: JDBC architecture, Establishing connectivity and working with connection interface, Working with statements, Creating and executing SQL statements, Working with Result Set. | This module has been designed as per BTL 6. |
12 | Java Networking: Networking concepts, socket programming, URL class, URLConnection class, HttpURLConnection, InetAddress class, | This module has been designed as per BTL 3 &66 |
Textbook References: –
1. Java: The Complete Reference Hebert Schildt, Mc Graw Hill 2. Object-Oriented Programming with C++ and Java Debasis Samanta, Prentice Hall India. Open Source References: – Other References:
|
(Bloom’s Taxonomy: BT level 1: Remembering; BT level 2: Understanding; BT level 3: Applying; BT level 4: Analyzing; BT level 5: Evaluating; BT level 6: Creating)
Syllabus
Program | MasterofComputerApplications |
Semester | II |
CourseTitle | Java Programming Practical |
Course Code | LMC0221 |
CourseCredits | 02 |
Course Type | CorePractical Course |
- CourseSummary
Java, created by James Gosling at Sun Microsystems in 1991, is a versatile, object-oriented programming language. It compiles applications into bytecode, which can run on any platform via the Java Virtual Machine (JVM). Due to this portability, Java is often referred to as a WORA (Write Once, Run Anywhere) language. In today’s tech landscape, Java remains highly popular for developing lightweight, fast, and customizable applications. Syntax resembles JAVA, and automatic garbage collection simplifies memory management.Modular programs with reusable code.Concepts like inheritance, encapsulation, and polymorphism enhance practicality. It provides strong memory management and exception handling.
- CourseContents
Sr.No | Units | UnitOutcomes
After the successful completion of theunit,the learnershould beableto: |
1 | Unit 1:IntroductiontoOOP
· Introduction to data abstraction, encapsulation,polymorphism · Javaprogram:StructureandHelloWorldExample · DiscussiononJava keywords, data types and packages. |
1. DiscussOOPfeatures.
2. ImplementsimpleJavaprogram. 3. Discusskeywordsandother packages. |
2 | Unit2: Java Complier
· Detail of JDK. · Syntaxand semanticerrors |
1. DemonstrateJavaprogramsusing JVM, JRE.
2. UnderstandtheinstallationprocedureforJDK. |
3 | Unit3:Editor for Java Program
· IntroductiontoNetBeans · Installation of NetBeans · DifferentmenusandsettingsinNetBeans |
· Understand installation of NetBeans. |
4 | Unit4:ListofExperiments | |
i. | Write a java program to print even numbers from 1 to 10. | · To understand how to use NetBeans for java. Apply java concepts using it. |
ii. | Java Program to create a student class and its child class extstud (Derived Class). Use constructors in both the classes and display data with their methods. | · To create classes using inheritance concepts. |
iii. | Create an Abstract Class Shape and its derived class Circle and Rectangle. Print area of rectangle and circle for given parameters passed in their constructors with an overridden method GetArea(); | · To understand and apply concept of abstract class and methods. |
iv. | Write a Java Program to create a static member variable, static block and static inner class. Write a static method to display it. | · To understand the use of static variable, block and inner class. |
v. | Write a program to create an interface and a class which implements it. Show the use of default method and override it and attribute of interface as final. | · To understand and apply interface along with class. |
vi. | Write a program to find number is positive, negative or zero. | · To understand and apply “if else” control structure. |
vii. | Write a program to explain switch case in java. | · To understand and apply “switch case” control structure. |
viii | Write a Program to explain loops with array in java. | · To use different kind of loops and array in java. |
ix. | Write a java program to explain usage of try, catch and finally blocks in exception handling. | · To understand apply and concept of exception handling |
x. | Write a java program to demonstrate thread and print 1 to 10 numbers by each thread. Use multi thread and synchronize them. | · To understand the concept of threads. |
xi. | Write a java program to demonstrate GUI using JFrame and JButton. | · To create GUI applications using java. |
xii. | Write a java program using GUI features to add and subtract given two values using JFrame, JButton etc. | · To create GUI application for addition and subtraction of two values. |
xiii. | Write a java program to read a text file input.txt and write another text file output.txt. | · To understand serialization and create application to read and write data in text file. |
xiv | Write a java program to connect database available in MySQL and perform input output transaction with a file of database. | · To create application using jdbc driver and connectivity with database for data processing. |
xv | Write a java program to demonstrate socket program using Server and Client class in NetBeans 22. | · To understand and create client server based applications. |
- CourseResources
- EssentialReading
- Balagurusamy, E. (2019). Programming with Java: A Primer (5th ed.). McGraw-Hill Education.
- Malhotra, S., & Choudhary, S. (2014). Programming in Java (2nd ed.). Oxford University Press.
- Schildt, H. (2018). Java: The Complete Reference (11th ed.). McGraw-Hill Education.
- RecommendedReading
- Bloch, J. (2018). Effective Java (3rd ed.). Addison-Wesley Professional.
- Sierra, K., & Bates, B. (2005). Head First Java (2nd ed.). O’Reilly Media.
- Pati, P. K., & Mohanty, R. (2016). Java Programming: A Comprehensive Introduction (1st ed.). Vikas Publishing House.
- Websites
- (n.d.). Object Oriented Programming in Java (University of California, San Diego). Retrieved from https://www.coursera.org/learn/object-oriented-java
- (n.d.). Introduction to Java Programming (Microsoft). Retrieved from https://www.edx.org/course/introduction-to-java-programming
- (n.d.). Learn Java. Retrieved from https://www.codecademy.com/learn/learn-java
- LinkedIn Learning. (n.d.). Java Essential Training (David Gassner). Retrieved from https://www.linkedin.com/learning/java-essential-training
- OtherElectronicResources
- CourseVideoLectureson LMS
Contents
Unit No | IntroductiontoObject-orientedprogramming | |
1 | Introduction …………………. | Page 1 |
2 | Java Development Kit…………………. | Page 3 |
3 | ListofExperiments…………………. | Page 6 |
4 | SamplePrograms…………………. | Page 9 |
5 | ExercisePrograms…………………. | Page22 |
6 | LabRecordSampleswithScreenshots…………………. | Page25 |
7 | RecommendedReading…………………. | Page28 |
Unit1: Introduction
Java is a widely-used programming language known for its versatility, portability, and security features. Java is a fully object-oriented programming language, and understanding its key Object-Oriented Programming (OOP) concepts is essential for effective Java development. Here are some key aspects of Java.
Classes and Objects:
Class: A class in Java is a blueprint or template for creating objects. It defines the properties (attributes) and behaviors (methods) that objects of the class will have.
Object: An object is an instance of a class. It represents a real-world entity and encapsulates data (attributes) and behaviors (methods).
Encapsulation:
Encapsulation is the mechanism of bundling the data (attributes) and methods (behaviors) that operate on the data into a single unit (class). It helps in hiding the internal state of an object and restricting access to it.
Inheritance:
Inheritance allows one class (subclass or derived class) to inherit the properties and behaviors of another class (superclass or base class). It promotes code reusability and allows the creation of a hierarchy of classes.
Polymorphism:
Polymorphism means “many forms” and refers to the ability of objects to respond differently to the same method call. In Java, polymorphism is achieved through method overriding (runtime polymorphism) and method overloading (compile-time polymorphism).
Abstraction:
Abstraction is the process of hiding the implementation details of methods and exposing only the functionality to the user. Abstract classes and interfaces in Java are used to achieve abstraction.
Association, Aggregation, and Composition:
These are relationships between classes:
Association: A relationship where one class is related to another class (e.g., a Car has a Driver).
Aggregation: A specialized form of association where an object of one class “has-a” relationship with another class, but it can exist independently (e.g., a University has Departments).
Composition: A stronger form of aggregation where one class owns another class and the owned class cannot exist independently (e.g., a Car has an Engine).
Interfaces and Abstract Classes:
Interface: An interface in Java defines a contract for classes to implement. It contains only method signatures (without implementations).
Abstract Class: An abstract class in Java cannot be instantiated on its own and may contain abstract methods (methods without implementations) and concrete methods.
Platform Independence: Java programs are compiled into an intermediate bytecode that can run on any Java Virtual Machine (JVM), regardless of the underlying computer architecture. This “write once, run anywhere” capability makes Java highly portable.
Object-Oriented: Java is fundamentally object-oriented, meaning it revolves around creating and manipulating objects. It supports principles such as inheritance, encapsulation, and polymorphism.
Syntax: Java syntax is largely influenced by C and C++, making it familiar to many programmers. It uses curly braces for code blocks and follows a strict structure for classes, methods, and variables.
Automatic Memory Management: Java uses a garbage collector to automatically manage memory allocation and deallocation, which helps developers avoid memory leaks and pointer-related errors.
Rich Standard Library: Java provides a vast standard library that includes classes and methods for tasks such as networking, I/O, data structures, and utilities, simplifying development by providing pre-written code for common functionalities.
Security: Java was designed with security in mind. The JVM sandboxing mechanism ensures that Java programs run securely and cannot harm the host system. This makes Java a popular choice for developing applications that require robust security measures.
Community and Ecosystem: Java has a large and active community of developers worldwide. It is used extensively in enterprise-level applications, web development (via technologies like Servlets and JSP), mobile applications (Android development), scientific computing, and more.
Unit2
Java Development Kit
Welcome to Apache NetBeans (Explained in Unit 3)
These installers include a local Java 22 JDK for the IDE to run on, offering a self-contained out-of-the-box experience. Additional JDK’s for projects may be registered and/or downloaded using Tools / Java Platforms in the IDE menu, supporting development of projects for Java 8 up to Java 22.
You can also install JAVA SE, JRE, SDK separately.
Installation of J2SDK.
Download and install Java for Windows computer.
Platform(s): Windows 8, Windows 7, Vista, Windows XP, Windows 2000,Windows 2003, Windows 2008 Server
Note: Installing Java requires that you can gain administrator access to Windows on your computer.
Download and Install
It is recommended; before you proceed with online installation you may want to disable your Internet firewall. In some cases, the default firewall settings are set to reject all automatic or online installations such as the Java online installation. If the firewall is not configured appropriately, it may stall the download/install operation of Java under certain conditions. Refer to your specific Internet firewall manual for instructions on how to disable your Internet Firewall.
- Go to the Manual download page
- Click on Windows Online
- The File Download dialog box appears prompting you to run or save the download file
To run the installer, click Run. - To save the file for later installation, click Save.
Choose the folder location and save the file to your local system.
Tip: Save the file to a known location on your computer, for example, to your desktop.
Double-click on the saved file to start the installation process. - The installation process starts. Click the Install button to accept the license terms and to continue with the installation.
Oracle has partnered with companies that offer various products. The installer may present you with option to install these programs when you install Java. After ensuring that the desired programs are selected, click the Next button to continue the installation.
A few brief dialogs confirm the last steps of the installation process; click Close on the last dialog. This will complete Java installation process.
Required Software/ Software Tool: –
Platform(s): Windows 8, Windows 7, Vista, Windows XP, Windows 2000, Windows 2003, Windows 2008 Server
Java version(s): 6.0, 7.0 (jdk1.6, jdk1.7)
Editor: – Net Beans IDE 6.9.1
Database: – Oracle9i / MySQL
Web server: – Apache Tomcat 5.5
The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes a variety of tools and components needed for Java development. Here’s an overview of the key components and features of the JDK:
Key Components of the JDK
Java Compiler (javac)
Converts Java source code (.java files) into bytecode (.class files) that can be executed by the Java Virtual Machine (JVM).
Run the Java Program
To run the compiled Java program, use the java command followed by the name of the class containing the main method, without the .class extension:
Java Runtime Environment (JRE)
Includes the JVM, core libraries, and other components to run applications written in Java.
Java Virtual Machine (JVM)
The engine that runs Java bytecode. It provides platform independence by allowing Java programs to run on any device or operating system.
Java Debugger (jdb)
A tool for finding and fixing bugs in Java programs.
Java Archive Tool (jar)
Packages multiple files into a single JAR file, which can be used for deployment.
Java Documentation Generator (javadoc)
Generates HTML documentation from Java source code comments.
Other Tools
Includes a variety of other utilities and tools such as javap (class file disassembler), jconsole (JMX-compliant monitoring and management tool), and more.
Set up Environment Variables:
- Set the JAVA_HOME environment variable to point to the JDK installation directory.
- Add the bin directory within the JDK installation directory to the PATH environment variable.
General Guidelines
Ineachlabsession,aspecificfeatureofOOPusingJava iscovered.Attempteachexerciserelatedto the sample list of experiments mentioned in the list. Each program must include generalcomments such as name, date of program development, description of the program, function, ablock of statements, etc. Every Java program must be interactive and the documentation forinput/outputmustbeclear.Eachlabassignmentmustbesubmittedintheformofalabrecord.Thelab record must include problem definition, algorithm/concept used, source code, and sampleinput/output.Thereare12unitsinthislaboratory.Anindicativelistofexperimentsis mentionedthatcoversmostoftheOOPfeatures. Foreachunitoneexperimentismentionedinthelist.Somemoreadditionalexercisesaregiveninthelatersections.
Unit 3
Editor for Java Program – NetBeans 22 with JDK 22
- Download NetBeans
- Install NetBeans
- Click on New Project
- Select Java Application and click next
- Select Java Application and click next
Unit4
Anindicativelistof experiments isgiven inTable 1.2.
ListofExperiments
Topic Covered | ProblemDefinition |
1 | Write a Java Program to find roots of quadratic equations. |
2 | Write a Java program to create a class known as “BankAccount” with methods called deposit() and withdraw(). Create a subclass called SavingsAccount that overrides the withdraw() method to prevent withdrawals if the account balance falls below one hundred. |
3 | Write a Java Program to create an abstract class named shape that contains two integers and an empty method named printArea.Provide three classes named Rectangle,Triangle and Circle subclass that each one of the classes extends the Class Shape. Each one of the classes contains only the method printArea() that prints the area of Shape. |
4 | Write a java program to computer the sum of array elements. |
5 | Write a java program to explain use of interface with any suitable problem. |
6 | Write a java program to find greatest among given three values. |
7 | Write a java program that implements Selection sort algorithm for sorting a list of numbers in ascending order. |
8 | Write a Program that creates User Interface to perform Integer Divisions.The user enters two numbers in text fields, Num1 and Num2.The division of Num1 and Num2 is displayed in the result field when the divide button clicked. If Num1 or Num2 were not integer, the program would throw a NumberFormatException,If Num2 is Zero, and the program would throw an Athematic Exception. Display theException in message box. |
9 | Write a JAVA program that creates threads by extending Thread class. First thread display “Good Morning “every 1 sec, the second thread displays “Hello “every 2 seconds and the third display “Welcome” every 3 seconds, (Repeat the same by implementing Runnable) |
10 | Write a java program that loads names and phone numbers from the text file where data is organized as one line per record and each field in record are separated by any delimiter. |
Table1.2List of experiments
SamplePrograms
EXPERIMENT-1
Problemdefinition:Write a Java program to print even numbers from 1 to 10.
SourceProgram:
package com.priy.even;
/** * * @author priya */ public class EVEN { public static void main(String[] args) { for ( int i=1; i<=10 ; i++) if ( i % 2 == 0 ) System.out.println(“Even No:”+i); } } |
Output:
Even No:2 Even No:4 Even No:6 Even No:8 Even No:10 |
MCQ
1. Number of primitive data types in Java are?
a) 6
b) 7
c) 8
d) 9
Ans. c
2. What is the size of float and double in Java?
a) 32 and 64
b) 32 and 32
c) 64 and 64
d) 64 and 32
Ans. a
3. Automatic type conversion is possible in which of the possible cases?
a) Byte to int
b) Int to long
c) Long to int
d) Short to int
Ans. B
4. When is the object created with new keyword?
a) At run time
b) At compile time
c) Depends on the code
d) None
Ans. a
5. Identify the correct definition of a package.
a) A package is a collection of editing tools
b) A package is a collection of classes
c) A package is a collection of classes and interfaces
d) A package is a collection of interfaces
Ans. c
6. Which of the following is not an OOPS concept in Java?
a) Polymorphism
b) Inheritance
c) Compilation
d) Encapsulation
Ans. c
EXPERIMENT-2
Problemdefinition:Java Program to create a student class and its child class extstud (Derived Class). Use constructors in both the classes and display data with their methods.
Source Program
package stud;
public class student { public String stdname; public int rollno; public student(String n,int r) { this.stdname = n; this.rollno = r; } public void dispstud() { System.out.println(“Student Name: “+this.stdname); System.out.println(“Student Rollno: “+this.rollno); }} package stud; public class extstud extends student{ public int extrafees; public extstud(String n,int r,int f) { super(n,r); extrafees = f; } public void extstuddisp() { super.dispstud(); System.out.println(“Extra Fees: “+ this.extrafees); } } package com.priy.priy; import stud.extstud; public class PRIY { public static void main(String[] args) { extstud obj1 = new extstud (“Trupti”,12,3000); obj1.extstuddisp(); } } |
Output:
Student Name: Trupti
Student Rollno: 12
Extra Fees: 3000
MCQ
1. Which of the following is not an OOPS concept in Java?
a) Polymorphism
b) Inheritance
c) Compilation
d) Encapsulation
Ans. c
2. What is not the use of “this” keyword in Java?
a) Referring to the instance variable when a local variable has the same name
b) Passing itself to the method of the same class
c) Passing itself to another method
d) Calling another constructor in constructor chaining
Ans. b
3. Identify the modifier which cannot be used for constructor.
a) public
b) protected
c) private
d) static
Ans. D
4. What is the implicit return type of constructor?
a) No return type
b) A class object in which it is defined
c) void
d) None
Ans. B
5. When is the finalize() method called?
a) Before garbage collection
b) Before an object goes out of scope
c) Before a variable goes out of scope
d) None
Ans. a
6. What is the extension of compiled java classes?
a) .txt
b) .js
c) .class
d) .java
Ans. c
EXPERIMENT3
ProblemDefinition:Create an Abstract Class Shape and its derived class Circle and Rectangle. Print area of rectangle and circle for given parameters passed in their constructors with an overridden method GetArea();
SourceProgram
package com.priy.abstclass;
// define abstract class
public abstract class Shape {
//define abstract method
public abstract double GetArea();
}
package com.priy.abstclass;
public class Circle extends Shape {
private double radius;
public Circle(double r) {
this.radius = r;
}
@Override
public double GetArea() {
return Math.PI * radius * radius;
}
}
package com.priy.abstclass;
public class Rectangle extends Shape{
private double width;
private double length;
public Rectangle(double w,double l)
{
this.width = w;
this.length = l;
}
@Override
public double GetArea() {
return width * length;
}
}
package com.priy.abstclass;
public class AbstClass {
public static void main(String[] args) {
Circle c = new Circle(5);
Rectangle r = new Rectangle (10,12);
System.out.println(“Area of Circle :”+ c.GetArea());
System.out.println(“Area of Rectangle :”+ r.GetArea());
}
}
SampleInput/Output
Output:
Area of Circle :78.53981633974483
Area of Rectangle :120.0
MCQ
1. What is an abstract class?
A) A class that cannot have any methods
B) A class that cannot have any properties
C) A class that cannot be instantiated and can have abstract methods
D) A class that must be instantiated to use its methods
Answer: C
2. What is an abstract method?
A) A method that is fully implemented in the abstract class
B) A method that is declared without an implementation
C) A method that can only be called from other abstract methods
D) A method that can only be used within the abstract class
Answer: B
3. What must a subclass do if it inherits from an abstract class containing abstract methods?
A) It must implement all of the abstract methods of the superclass
B) It can ignore the abstract methods of the superclass
C) It must remain abstract itself
D) It cannot add any new methods of its own
Answer: A
4. Can an abstract class have a constructor?
A) Yes, and it can be called using the super keyword from subclasses.
B) No, an abstract class cannot have a constructor.
C) Yes, but it cannot be used by any subclasses.
D) No, constructors are only for concrete classes.
Answer: A
5. In Java, which keyword is used to declare a class as abstract?
A) virtual
B) abstract
C) interface
D) extends
Answer: B
6. Can abstract classes implement interfaces?
A) No, abstract classes cannot implement interfaces.
B) Yes, but they must provide implementations for all interface methods.
C) Yes, and they can choose to implement none, some, or all of the interface methods.
D) Yes, but only if the interface methods are declared abstract.
Answer: C
EXPERIMENT4
ProblemDefinition:Write a Java Program to create a static member variable, static block and static inner class. Write a static method to display it.
package com.priy.astat;
public class Astat { static int a = 10; /* A static method belongs to the class rather than any instance of the class. It can be called without creating an instance of the class. Static methods can access static variables and other static methods directly. They cannot access instance variables or instance methods directly because they do not operate on a specific instance. */ /* Static blocks are used for static initialization of a class. They run once when the class is first loaded into memory. */ /* A static inner class (nested static class) can be instantiated without an instance of the outer class. It can access static members of the outer class but cannot access instance members. */ static class B { static void smethod() { /* A static variable is shared among all instances of a class. It can be accessed directly using the class name, without needing to instantiate the class. */ System.out.println(“This is static method”); System.out.println(“Value of a:” + Astat.a); } } public static void main(String[] args) { Astat.B.smethod(); } } |
SourceProgram:
This is static method
Value of a:10 |
SampleInput/Output
MCQ
1. What is the role of a constructor in classes?
a) To modify the data whenever required
b) To destroy an object
c) To initialize the data members of an object when it is created
d) To call private functions from the outer world
Ans. c
2. What happens if a user forgets to define a constructor inside a class?
a) Error occurs
b) Segmentation fault
c) Objects are not created properly
d) Compiler provides a default constructor to avoid faults/errors
Ans. d
3. How constructors are different from other member functions of the class?
a) Constructor has the same name as the class itself
b) Constructors do not return anything
c) Constructors are automatically called when an object is created
d) All of the mentioned
Ans. d
4. How many types of constructors are there in JAVA?
a) 1
b) 2
c) 3
d) 4
Ans. c
5. When destructors are called?
a) When a program ends
b) When a function ends
c) When a delete operator is used
d) All of the mentioned
Ans. d
6. What is the difference between constructors and destructors?
a) They have a different function name
b) Constructors does not have return type whereas destructors do have
c) Constructors allow function parameters whereas destructors do not
d) Constructors does not function parameters
Ans. c
EXPERIMENT – 5
Problem Definition: Write a program to create an interface and a class which implements it. Show the use of default method and override it and attribute of interface as final.
package com.priy.intfabc;
public interface human {
public int age=56;
default void humanprint() {
System.out.println(“I am a human”);
}
}
package com.priy.intfabc;
public interface man extends human {
public void husband();
public void son();
}
package com.priy.intfabc;
public class Teacher implements man {
@Override
public void humanprint()
{
System.out.println(“I am a human – overriding default method”);
}
@Override
public void husband() {
System.out.println(“I am a husband”);
}
@Override
public void son() {
System.out.println(“I am a son”);
}
}
package com.priy.intfabc;
/* Interface fields are public, static and final by default,
and the methods are public and abstract. */
/* a class extends another class, an interface extends another interface,
but a class implements an interface.*/
public class IntfABC {
public static void main(String[] args) {
Teacher a = new Teacher();
// a.age= 60; not possible
System.out.println(a.age );
a.humanprint();
a.husband();
a.son();
}
}
Output:
56
I am a human – overriding default method
I am a husband
I am a son
MCQ
1. What is an interface in Java?
A) A class that can have concrete methods
B) A class that can be instantiated
C) A reference type, similar to a class, that can contain only abstract methods, default methods, static methods, and final variables
D) A class that can extend multiple classes
Answer: C
2. Which keyword is used to implement an interface in a class in Java?
A) extends
B) implements
C) interface
D) inherits
Answer: B
3. Can an interface in Java contain instance variables?
A) Yes, but they must be initialized
B) No, it can only contain final variables
C) Yes, and they can be modified by implementing classes
D) No, it cannot contain any variables
Answer: B
4. Which of the following can an interface contain in Java?
A) Abstract methods
B) Default methods
C) Static methods
D) All of the above
Answer: D
5. What is the purpose of a default method in an interface?
A) To provide a default implementation for all classes
B) To allow methods to be overridden
C) To provide a common method implementation without affecting existing classes that implement the interface
D) To declare a method as optional
Answer: C
6. Can an interface extend another interface in Java?
A) Yes, and it can extend multiple interfaces
B) No, interfaces cannot extend other interfaces
C) Yes, but only one interface
D) No, interfaces can only implement other interfaces
Answer: A
EXPERIMENT – 6
Problem Definition: Write a program to find number is positive, negative or zero.
SourceProgram:
package com.priy.contstrut;
import java.util.Scanner;
public class ContStrut {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print(“Enter an integer :”);
int num = scanner.nextInt();
if ( num> 0 ) {
System.out.println(“Number is Positive”);
}
else if (num == 0) {
System.out.println(“Number is zero”);
}
else {
System.out.println(“Number is Negative”);
}
}
}
Output:
Enter an integer :-5
Number is Negative
Enter an integer :0
Number is zero
Enter an integer :5
Number is Positive
MCQ
1. Which of the following is a valid control structure in Java?
A) for
B) while
C) do-while
D) All of the above
Answer: D
2. Which of the following loops is guaranteed to execute at least once?
A) for
B) while
C) do-while
D) None of the above
Answer: C
3. What is the purpose of the break statement in a loop?
A) To skip the current iteration and proceed to the next iteration
B) To exit the loop immediately
C) To skip the rest of the code inside the loop for the current iteration
D) To pause the loop execution
4. Answer: B
Which control structure is used to handle exceptions in Java?
A) try-catch
B) if-else
C) for
D) while
5. Answer: A
Which of the following statements about the switch statement is true?
A) It can only evaluate int values
B) It can evaluate int, char, byte, short, String, and enum types
C) It can evaluate boolean values
D) It cannot have a default case
Answer: B
6. Which of the following is true about the continue statement?
A) It exits the loop immediately
B) It skips the current iteration and proceeds to the next iteration of the loop
C) It pauses the loop execution
D) It terminates the program
Answer: B
EXPERIMENT–7
ProblemDefinition:Write a program to explain switch case in java.
SourceProgram
package com.priy.contstrut;
import java.util.Scanner;
public class ContStrut {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print(“Enter number of day from (1 – 7) :”);
int day = scanner.nextInt();
switch(day)
{
case 1:
System.out.print(“Given Day is Sunday”);
break;
case 2:
System.out.print(“Given Day is Monday”);
break;
case 3:
System.out.print(“Given Day is Tuesday”);
break;
case 4:
System.out.print(“Given Day is Wednesday”);
break;
case 5:
System.out.print(“Given Day is Thursday”);
break;
case 6:
System.out.print(“Given Day is Friday”);
break;
case 7:
System.out.print(“Given Day is Saturday”);
break;
default :
System.out.print(“Your input is wrong”);
}
}
}
Output:
Enter number of day from (1 – 7) :2
Given Day is Monday
MCQ
1. Which of the following types can be evaluated in a switch statement in Java?
A) int
B) char
C) String
D) All of the above
Answer: D
2. Which keyword is used to exit a switch statement in Java?
A) exit
B) continue
C) break
D) return
Answer: C
3. What happens if there is no break statement in a switch case?
A) The code will not compile
B) The program will exit the switch statement after the current case
C) The execution will fall through to the next case
D) The default case will be executed
Answer: C
4. Is it mandatory to have a default case in a switch statement?
A) Yes
B) No
Answer: B
5. Can a switch statement evaluate a boolean value?
A) Yes
B) No
Answer: B
6. What is the purpose of the default case in a switch statement?
A) To handle a situation where no case matches the switch expression
B) To terminate the switch statement
C) To provide a value for the switch expression
D) To ignore unmatched cases
Answer: A
EXPERIMENT-8
ProblemDefinition:Write a Program to explain loops with array in java.
SourceProgram
package com.priy.contstrut;
import java.util.Scanner; // program to understand loops in java public class ContStrut { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter value of counter i :”); for ( int i = scanner.nextInt(); i <= 10 ;i++) { System.out.println(“i = “+i); } int i = 5; while ( i <= 15){ System.out.println(“i = “+ i++); } do { System.out.println(“i = “+ i++); } while ( i <= 20); int[] numbers = {30,32,35,36,42}; for(int n : numbers) { System.out.println(“n = “+ n++); } } } |
Enter value of counter i :7
i = 7 i = 8 i = 9 i = 10 i = 5 i = 6 i = 7 i = 8 i = 9 i = 10 i = 11 i = 12 i = 13 i = 14 i = 15 i = 16 i = 17 i = 18 i = 19 i = 20 n = 30 n = 32 n = 35 n = 36 n = 42 |
SampleInput/Output
MCQ
- Select the valid statement.
a) char[] ch = new char(5)
b) char[] ch = new char[5]
c) char[] ch = new char()
d) char[] ch = new char[]
Ans. b
- When an array is passed to a method, what does the method receive?
a) The reference of the array
b) A copy of the array
c) Length of the array
d) Copy of the first element
Ans. a
- Select the valid statement to declare and initialize an array.
a) int[] A = {}
b) int[] A = {1, 2, 3}
c) int[] A = (1, 2, 3)
d) int[][] A = {1, 2, 3}
Ans. b
- Arrays in java are-
a) Object references
b) objects
c) Primitive data type
d) None
Ans. b
- Which of the following statements is true about the while loop?
A) The loop is guaranteed to execute at least once.
B) The loop might not execute at all if the condition is false initially.
C) The loop always executes a fixed number of times.
D) The loop cannot be exited using a break statement.
Answer: B
- Which of the following statements is true about the for loop?
A) It is used for an infinite loop only.
B) It can have an initialization, condition, and increment/decrement in one line.
C) It cannot be used with arrays.
D) It cannot be nested.
Answer: B
EXPERIMENT – 9
Problem definition: Write a java program to explain usage of try, catch and finally blocks in exception handling.
Source Program
package com.priy.ehand;
public class Ehand { public static void main(String[] args) { try { int r = divide(10,0); // divide by zero // int r = divide(10,2); // Result = 5 System.out.println(“Result =” + r); } catch (ArithmeticException e) { System.out.println(e.getMessage()); } finally { System.out.println(“finally block always executed”); } } public static int divide(int a, int b) throws ArithmeticException { if (b==0) { throw new ArithmeticException(“Error – Divide by zero”); } else return a/b; } } |
Error – Divide by zero
finally block always executed Result =5 finally block always executed |
SampleInput/Output
MCQ
- Exception created by try block is caught in which block
a) catch
b) throw
c) final
d) none
Ans. a
- What is the use of the throws keyword in Java?
A) To declare that a method can throw exceptions
B) To handle an exception
C) To rethrow an exception
D) To catch an exception
Answer: A
- Which of the following is not a runtime exception in Java?
A) ClassCastException
B) IllegalArgumentException
C) IOException
D) NullPointerException
Answer: C
- Which of the following exception is thrown when divided by zero statement is executed?
a) NullPointerException
b) NumberFormatException
c) ArithmeticException
d) None
Ans. c
- Which of the following exceptions is thrown when a method receives an invalid argument?
A) IllegalArgumentException
B) ArrayIndexOutOfBoundsException
C) NullPointerException
D) ClassCastException
Answer: A
- Can a finally block be used without a catch block in Java?
A) Yes
B) No
Answer: A
EXPERIMENT – 10
Problem definition: Write a java program to demonstrate thread and print 1 to 10 numbers by each thread. Use multi thread and synchronize them.
Source Program
package com.priy.thproj;
public class PrintN extends Thread { String ThreadName; PrintN(String tn) { ThreadName = tn; } @Override public void run() { for (int i=1; i<=10 ;i++) { System.out.println(ThreadName+ “:” + i); } try { Thread.sleep(2000); } catch(InterruptedException e) { System.out.println(“Thread Interrupted”); } } } ___________________________________________________________________________ package com.priy.thproj; public class THPROJ { public static void main(String[] args) { PrintN t1 = new PrintN ( “Thread-1”); PrintN t2 = new PrintN ( “Thread-2”); t1.start(); t2.start(); try { t1.join(); t2.join(); } catch(InterruptedException e) { System.out.println(“Thread Interrupted”); } System.out.println(“Done”); } } |
Thread-2:1
Thread-2:2 Thread-2:3 Thread-2:4 Thread-2:5 Thread-2:6 Thread-2:7 Thread-2:8 Thread-1:1 Thread-2:9 Thread-2:10 Thread-1:2 Thread-1:3 Thread-1:4 Thread-1:5 Thread-1:6 Thread-1:7 Thread-1:8 Thread-1:9 Thread-1:10 Done |
SampleInput/Output
MCQ
- Which class is used to create a thread in Java?
A) Runnable
B) Thread
C) Callable
D) Executor
Answer: B
- Which interface must be implemented to create a thread in Java?
A) Thread
B) Callable
C) Runnable
D) Executor
Answer: C
- What method must be overridden when implementing the Runnable interface?
A) start()
B) run()
C) execute()
D) call()
Answer: B
- Which of the following methods is used to start a thread execution?
A) run()
B) execute()
C) start()
D) begin()
Answer: C
- What is the state of a thread when it is executing?
A) Runnable
B) Running
C) Waiting
D) Blocked
Answer: B
- Which method is used to pause the execution of a thread for a specified period?
A) wait()
B) sleep()
C) pause()
D) stop()
Answer: B
EXPERIMENT- 11
Problem definition: Write a java program to demonstrate GUI using JFrame and JButton.
Source Program
package com.priy.swingex;
import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; /** * * @author priya */ public class SwingEx { public static void demoGui() { //creating the frame JFrame frame = new JFrame(“Swing Example”); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300,200); //creating a button JButton button = new JButton(“Click Here”); button.addActionListener(e -> JOptionPane.showMessageDialog(frame,frame.getContentPane().add(button))); // Adding the button on the frame frame.getContentPane().add(button); //Display the window frame.setVisible(true); } public static void main(String[] args) { demoGui(); } } |
Sample Input / Output
MCQ
1. Which method is used to close a JFrame when the close button is clicked?
A) setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
B) setCloseOperation(JFrame.EXIT_ON_CLOSE)
C) setOperation(JFrame.EXIT_ON_CLOSE)
D) setWindowClose(JFrame.EXIT_ON_CLOSE)
Answer: A
2. What is JButton in Java Swing?
A) A class that represents a text field
B) A class that represents a button
C) A class that represents a window
D) A class that represents a panel
Answer: B
3. Which method is used to set the text of a JButton?
A) setText()
B) setLabel()
C) setButtonText()
D) setCaption()
Answer: A
4. How do you add a JButton to a JFrame?
A) frame.add(button)
B) frame.insert(button)
C) frame.put(button)
D) frame.append(button)
Answer: A
5. Which interface must be implemented to handle button click events in Java Swing?
A) ActionListener
B) MouseListener
C) KeyListener
D) WindowListener
Answer: A
6. How do you register an ActionListener with a JButton?
A) button.addActionListener(listener)
B) button.setActionListener(listener)
C) button.registerActionListener(listener)
D) button.addListener(listener)
Answer: A
EXPERIMENT – 12
Problem definition: Write a java program using GUI features to add and subtract given two values using JFrame, JButton etc.
Source Program
package com.priy.additionsubtraction;
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class AdditionSubtraction extends JFrame implements ActionListener { private JTextField num1Field; private JTextField num2Field; private JLabel resultLabel; public AdditionSubtraction(){ setTitle(“Addition and Subtraction”); setSize(300,200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationRelativeTo(null); // Create components JLabel num1Label = new JLabel(“Number 1:”); JLabel num2Label = new JLabel(“Number 2:”); num1Field = new JTextField(10); num2Field = new JTextField(10); JButton addButton = new JButton(“Add”); JButton subtractButton = new JButton(“Subtract”); resultLabel = new JLabel(“Result: “); // Add action listeners addButton.addActionListener(this); subtractButton.addActionListener(this); // Set layout and add components setLayout(new GridLayout (5,2)); add(num1Label); add(num1Field); add(num2Label); add(num2Field); add(addButton); add(subtractButton); add(resultLabel); } |
Sample Input / Output
@Override
public void actionPerformed(ActionEvent e) { try { double num1 = Double.parseDouble(num1Field.getText()); double num2 = Double.parseDouble(num2Field.getText()); String command = e.getActionCommand(); if (command.equals(“Add”)) { double result = num1 + num2; resultLabel.setText (“Result: ” + result); } else if (command.equals (“Subtract”)) { double result = num1 – num2; resultLabel.setText (“Result: ” + result); } } catch (NumberFormatException ex) { resultLabel.setText(“Invalid input!”); } } public static void main(String[] args) { SwingUtilities.invokeLater(() -> { AdditionSubtraction app = new AdditionSubtraction(); app.setVisible(true); }); } } |
MCQ
1. Which of the following is the base class for all Swing components?
A) Component
B) Container
C) JComponent
D) SwingComponent
Answer: C
2. Which layout manager arranges components in a single row or column?
A) FlowLayout
B) BorderLayout
C) GridLayout
D) BoxLayout
Answer: D
3. Which method is used to make a JFrame visible?
A) setDisplay(true)
B) setVisible(true)
C) show()
D) display()
Answer: B
4. Which component is used to create a dialog box in Java Swing?
A) JDialog
B) JOptionPane
C) JMessageBox
D) JDialogBox
Answer: A
5. Which method is used to add a component to a JPanel?
A) panel.addComponent(component)
B) panel.addItem(component)
C) panel.add(component)
D) panel.insert(component)
Answer: C
6. What is the default layout manager for a JPanel?
A) FlowLayout
B) BorderLayout
C) GridLayout
D) CardLayout
Answer: A
EXPERIMENT – 13
Problem definition: Write a java program to read a text file input.txt and write another text file output.txt.
import java.io.*;
public class IOPROJECT { public static void main(String[] args) { // File paths String inputFilePath = “input.txt”; String outputFilePath = “output.txt”; // Read from a file try (BufferedReader reader = new BufferedReader(new FileReader(inputFilePath))) { String line; while ((line = reader.readLine()) != null) { System.out.println(“Read from file: ” + line); } } catch (IOException e) { System.err.println(“Error reading from file: ” + e.getMessage()); } // Write to a file try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFilePath))) { writer.write(“Hello, World!”); writer.newLine(); writer.write(“This is a sample file output.”); System.out.println(“Successfully wrote to the file.”); } catch (IOException e) { System.err.println(“Error writing to file: ” + e.getMessage()); } } } |
Source Program
Sample Input / Output
Read from file: I love India.
Read from file: I love you all.
Successfully wrote to the file.
MCQ
1. Which of the following is used to create a new file if it does not exist?
A) File.createNewFile()
B) File.newFile()
C) FileWriter.create()
D) File.create()
Answer: A
2. Which method of the Files class can be used to read all lines from a file as a List?
A) readAllLines()
B) readLines()
C) getLines()
D) fetchLines()
Answer: A
3. How do you write an array of strings to a file using Files class?
A) Files.write(Path, List, StandardCharsets.UTF_8)
B) Files.write(Path, String[], StandardCharsets.UTF_8)
C) Files.write(Path, Arrays.asList(String[]), StandardCharsets.UTF_8)
D) Files.write(Path, String[], StandardCharsets.UTF_8)
Answer: C
4. What does the FileInputStream class do?
A) Reads data from a file in binary format
B) Writes data to a file in text format
C) Reads and writes data from/to a file in text format
D) Creates a new file
Answer: A
5. Which class can be used to read binary data from a file?
A) FileReader
B) BufferedReader
C) DataInputStream
D) PrintWriter
Answer: C
6. How can you append data to an existing file using FileWriter?
A) new FileWriter(“file.txt”, true)
B) new FileWriter(“file.txt”, false)
C) new FileWriter(“file.txt”)
D) new FileWriter(“file.txt”, append=true)
Answer: A
EXPERIMENT – 14
Problem definition: Write a java program to connect database available in MySQL and perform input output transaction with a file of database.
To create a Java program that connects to a MySQL database, you need to follow these steps:
Set up MySQL:
Ensure you have MySQL installed and running.
Create a database and a table with some sample data.
Download the MySQL Connector/J:
Download the MySQL Connector/J from the official MySQL website. (MySQL :: Download Connector/J)
Add the MySQL Connector/J JAR file to your NetBeans project.
Create a new Java project in NetBeans and write the code:
import java.sql.Connection;
import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import com.mysql.cj.jdbc.Driver; public class MySQLJDBCExample { public static void main(String[] args) { // Database credentials String jdbcURL = “jdbc:mysql://localhost:3306/example_db?zeroDateTimeBehavior=CONVERT_TO_NULL”; String username = “root”; String password = “root”; // Change this to your MySQL root password Connection connection = null; Statement statement = null; try { // Establish connection to the database connection = DriverManager.getConnection(jdbcURL, username, password); if (connection != null) { System.out.println(“Connected to the database!”); // Create a statement object to perform queries statement = connection.createStatement(); // Execute a query to retrieve data String sql = “SELECT * FROM users”; ResultSet resultSet = statement.executeQuery(sql); |
Source Program
// Process the result set
while (resultSet.next()) { int id = resultSet.getInt(“id”); String name = resultSet.getString(“name”); String email = resultSet.getString(“email”); System.out.println(“ID: ” + id + “, Name: ” + name + “, Email: ” + email); } // Close the result set resultSet.close(); } } catch (Exception e) { e.printStackTrace(); } finally { try { // Close the statement and connection if (statement != null) { statement.close(); } if (connection != null) { connection.close(); } } catch (Exception e) { e.printStackTrace(); } } } } |
Sample Input / Output
With connection string
jdbcURL = “jdbc:mysql://localhost:3306/example_db?zeroDateTimeBehavior=CONVERT_TO_NULL”;
Connected to the database!
Connected to the database!
ID: 1, Name: Ram, Email: Ram@example.com
ID: 2, Name: Sit, Email: Sita@example.com
With connection string
jdbcURL = “jdbc:mysql://localhost:3306/mysql?zeroDateTimeBehavior=CONVERT_TO_NULL”;
Connected to the database!
ID: 1, Name: Ghanshyan, Email: ghan@example.com
ID: 2, Name: radha, Email: radha@example.com
MCQ
1. Which environment variable is used to set the java path?
a) MAVEN_Path
b) JavaPATH
c) JAVA
d) JAVA_HOME
Ans. d
2. Which class in Java provides the connection to the database?
A) Statement
B) Connection
C) DriverManager
D) ResultSet
Answer: B
3. How do you load the MySQL JDBC driver in Java?
A) Class.forName(“com.mysql.jdbc.Driver”)
B) DriverManager.loadDriver(“com.mysql.jdbc.Driver”)
C) Driver.load(“com.mysql.jdbc.Driver”)
D) new com.mysql.jdbc.Driver()
Answer: A
4. Which method of DriverManager class is used to establish a connection to the database?
A) getConnection()
B) connect()
C) createConnection()
D) open()
Answer: A
5. Which JDBC method is used to execute an SQL query?
A) execute()
B) executeQuery()
C) run()
D) executeSQL()
Answer: B
6. Which class is used to execute SQL queries and updates in JDBC?
A) Connection
B) ResultSet
C) Statement
D) PreparedStatement
Answer: C
7. Which method is used to close the Connection object in JDBC?
A) disconnect()
B) close()
C) terminate()
D) end()
Answer: B
EXPERIMENT – 15
Problem definition:Write a java program to demonstrate socket program using Server and Client class in NetBeans 22.
Server Class
import java.io.*; import java.net.*; public class Server { public static void main(String[] args) { try (ServerSocket serverSocket = new ServerSocket(12345)) { System.out.println(“Server started and waiting for clients…”); Socket socket = serverSocket.accept(); System.out.println(“Client connected.”); // Reading from the client BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream())); String message = input.readLine(); System.out.println(“Received from client: ” + message); // Responding to the client PrintWriter output = new PrintWriter(socket.getOutputStream(), true); output.println(“Hello, client!”); socket.close(); } catch (IOException e) { e.printStackTrace(); } } } |
Source Program
Client Class
import java.io.*; import java.net.*; public class Client { public static void main(String[] args) { try (Socket socket = new Socket(“localhost”, 12345)) { // Sending a message to the server PrintWriter output = new PrintWriter(socket.getOutputStream(), true); output.println(“Hello, server!”); // Reading the server’s response BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream())); String message = input.readLine(); System.out.println(“Received from server: ” + message); } catch (IOException e) { e.printStackTrace(); } } } |
Sample Input / Output
– Server Side
Server started and waiting for clients…
Client connected.
Received from client: Hello, server!
– Client Side
Received from server: Hello, client!
MCQ
- Which class is used to create a server socket in Java?
A) Socket
B) ServerSocket
C) DatagramSocket
D) SocketChannel
Answer: B
- Which method of ServerSocket is used to accept incoming client connections?
A) accept()
B) connect()
C) listen()
D) receive()
Answer: A
- Which class is used to create a client socket in Java?
A) Socket
B) ServerSocket
C) DatagramSocket
D) SocketChannel
Answer: A
- What is the purpose of the getInputStream() method in a socket connection?
A) To obtain a stream to read data from the socket
B) To send data to the socket
C) To close the socket connection
D) To create a new socket connection
Answer: A
- Which method of Socket class is used to send data to the server?
A) getOutputStream()
B) send()
C) write()
D) transfer()
Answer: A
- Which of the following methods is used to close a socket connection?
A) close()
B) disconnect()
C) shutdown()
D) terminate()
Answer: A
- What is the purpose of the BufferedReader class in a socket program?
A) To buffer data before sending it over the network
B) To read data from an input stream efficiently
C) To write data to an output stream efficiently
D) To create a new socket connection
Answer: B
ExercisePrograms
Topic Covered | Problem Definition |
Introduction to JAVA | Write a Java Program to find roots of quadratic equations. |
inheritance | Write a Java program to create a class known as “BankAccount” with methods called deposit() and withdraw(). Create a subclass called SavingsAccount that overrides the withdraw() method to prevent withdrawals if the account balance falls below one hundred. |
Abstract Class and Methods | Write a Java Program to create an abstract class named shape that contains two integers and an empty method named printArea. Provide three classes named Rectangle, Triangle and Circle subclass that each one of the classes extends the Class Shape. Each one of the classes contains only the method printArea() that prints the area of Shape. |
Array and Loops | Write a java program to computer the sum of array elements. |
Interface | Write a java program to explain use of interface with any suitable problem. |
Control Structure | Write a java program to find greatest among given three values. |
Loop Structure | Write a java program that implements Selection sort algorithm for sorting a list of numbers in ascending order. |
GUI Interface with Exception Handling | Write a Program that creates User Interface to perform Integer Divisons. The user enters two numbers in text fields, Num1 and Num2.The division of Num1 and Num2 is displayed in the result field when the divide button clicked. If Num1 or Num2 were not integer, the program would throw a NumberFormatException,If Num2 is Zero, and the program would throw an Athematic Exception. Display theException in message box. |
Threads | Write a JAVA program that creates threads by extending Thread class. First thread display “Good Morning “every 1 sec, the second thread displays “Hello “every 2 seconds and the third display “Welcome” every 3 seconds, (Repeat the same by implementing Runnable) |
Serializations | Write a java program that loads names and phone numbers from the text file where data is organized as one line per record and each field in record are separated by any delimiter. |
Sample LabRecords
The screenshots for JAVA programs using NetBeans are given below. Each experimentmustbewrittenwithproblemdefinition,of thesourceprogram and input/output.
Problem definition: Create an array of integers and print the addition of elements of anarray using java.
Program:
SampleInput/Output
Recommended Reading
Textbook(s)
- Balagurusamy, E. (2019). Programming with Java: A Primer (5th ed.). McGraw-Hill Education.
- Gupta, A. (2018). Java: A Beginner’s Guide (8th ed.). McGraw-Hill Education.
- Patel, S. (2015). Java: The Complete Reference (8th ed.). McGraw-Hill Education.
- Naughton, P., & Schildt, H. (2014). The Complete Reference Java 2 (5th ed.). Tata McGraw-Hill Education.
Reference Book(s)
- Bloch, J. (2018). Effective Java (3rd ed.). Addison-Wesley Professional.
- Schildt, H. (2018). Java: The Complete Reference (11th ed.). McGraw-Hill Education.
Websites(s)
- (2023, July 17). The Java™ tutorials. Oracle. https://docs.oracle.com/javase/tutorial/https://www.Javatpoint.com/cpp-tutorial
- (2023, January 5). Introduction to Java. GeeksforGeeks. https://www.geeksforgeeks.org/introduction-to-java/
- (n.d.). Java tutorial. W3Schools. https://www.w3schools.com/java/
- Patil, P. (n.d.). Java programming [Online course]. NPTEL. https://nptel.ac.in/courses/106105191/
Course Code: LMC0201 | Course Title:Operating Systems (3 Credits) |
Course Objectives: –
Ø To understand the evolution and fundamental concepts of operating systems. Ø To explore CPU scheduling algorithms and their evaluation. Ø To develop an understanding of process management, synchronization, and deadlock handling. Ø To gain knowledge of memory virtualization and storage systems. Ø To learn about distributed operating systems and their communication, resource management, protection, and security. Ø To acquire skills in advanced operating systems topics and Unix commands. |
Course Contents
Unit | Unit Description | Learning Outcome |
1 | Principles of Computer Organization: Introduction to block diagram of computer, central processing unit, minicomputer and microcontroller, programming languages: machine language, assembly language, and high-level language | This module has been designed as per BTL 1. |
2 | Basic Computer Organization and Design: Instruction format, instruction execution cycle, registers, addressing modes, register transfer language | This module has been designed as per BTL 1 & 2. |
3 | Instruction Set Architecture (ISA): Introduction to instruction set, types of ISA – RISC, CISC, CISC characteristics, RISC characteristics | This module has been designed as per BTL 3 & 4. |
4 | Data Representation and Arithmetic: Fixed point representation, floating point representation, addition and subtraction of signed numbers, multiplication of positive numbers, floating point arithmetic: addition and multiplication | This module has been designed as per BTL 4. |
5 | Machine Instructions and Programs: Assembly language, basic input and output operations, stacks and queues, subroutines | This module has been designed as per BTL 3, 4 & 5. |
6 | Input-Output Organization: Accessing I/O devices, interrupts – hardware and software interrupt, enabling and disabling interrupts, handling multiple devices, direct memory access | This module has been designed as per BTL 5. |
7 | Memory Organization: Memory hierarchy, main memory, auxiliary memory, associative memory, cache and virtual memory, memory interleaving | This module has been designed as per BTL 3. |
8 | Basic Processing Unit: Some fundamental concepts, execution of a complete instruction, bus structure: data bus, address bus and control bus, multiple bus organization, hard-wired control | This module has been designed as per BTL 3 & 4. |
9 | Microprogramming Control: Types of micro-programmed control unit, control memory, address sequencing, design of control unit, microprogram sequencer | This module has been designed as per BTL 3 & 4. |
10 | Pipeline and Vector Processing: Overview of parallel processing, pipelining, principles of pipelining, arithmetic pipeline, instruction pipeline, array processor, vector processor | This module has been designed as per BTL 4 & 5. |
11 | Multicores, Multiprocessors, and Clusters: The switch from uniprocessors to multiprocessors, characteristics of multiprocessors, shared memory multiprocessors, Flynn’s classification | This module has been designed as per BTL 4. |
12 | Advanced Computer Architecture: Superscalar processors, study and comparison of uniprocessors and parallel processors | This module has been designed as per BTL 4. |
Textbook References:
1. Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, “Operating System Concepts,” Ninth Edition, Wiley Publication.
Other References:
|
(Bloom’s Taxonomy: BT level 1: Remembering; BT level 2: Understanding; BT level 3: Applying; BT level 4: Analyzing; BT level 5: Evaluating; BT level 6: Creating)
Course Code: LMC0203 | Course Title: Software Engineering (3 Credits) |
Course Objective:-
Ø To have hands on experience in developing a software project by using various software engineering principles and methods in each of the phases of software development. |
Course Contents
Unit | Unit description | Learning Outcome |
1 | Introduction: The Evolving role of software, software characteristics, software crisis, software Myths, | This module has been designed as per BTL 1 & 2. |
2 | Software Process Model: Software Process, Methods and Tools, software process, software process models: prototyping model, RAD model, Incremental models, spiral model | This module has been designed as per BTL 3&5. |
3 | Software process and project metrics: Measures, metrics and indicators, process metrics and software process improvement, software measurement: size-oriented metrics, function-oriented metrics. | This module has been designed as per BTL 3&4. |
4 | Software project planning: Observations on estimating, project planning objectives, software scope: obtaining information necessary for scope, resources: human resources, reusable software resources, software project estimation, software sizing, problem based estimation, LOC,FP-based estimation, process based estimation, COCOMO model | This module has been designed as per BTL 3 & 6. |
5 | System engineering: computer based systems, system modelling, system simulation, requirement engineering: requirement elicitation, requirement analysis and negotiation, requirement specification, requirement validation, requirement management. | This module has been designed as per BTL 3 & 6. |
6 | Analysis Modeling in Software Engineering: Objectives of Analysis Modeling, Elements of Analysis Model, Key Principles of Analysis Modeling, Various Approaches of Partitioning, Software Prototyping: Prototyping Methods, Prototyping Tools | This module has been designed as per BTL 3 &6. |
7 | Design concepts and principles: The design process, design principles, Modular Design: Strategy of Design , cohesion and coupling. | This module has been designed as per BTL 3. |
8 | SOFTWARE VERIFICATION AND VALIDATION: Unit Testing, Integration and System Testing, Static Confirmation, Dynamic Testing, Traceability Matrices , Automated Testing, Other Specialized Testing, white box testing, basis path testing: Cyclomatic Complexity, black box testing, Traceability Matrix | This module has been designed as per BTL 3&4. |
9 | SOFTWARE QUALITY AND SECURITY: Software Quality Concepts, Software Configuration Management (CM), Software Quality Assurance (SQA), Software Quality and Agile Methods Software Metrics and Analytics, The Quality Management Standards and Procedures | This module has been designed as per BTL 3&4. |
10 | RISK MANAGEMENT: Concept of Risk and Risk Management, Risk Management Activities, Effective Risk Management, Risk Categories, Risk Prioritization, Agile Risk Management | This module has been designed as per BTL 4&5. |
11 | Object oriented concepts and principles: The object-oriented paradigm, OOAD – Object Model : Objects and Classes, Object Oriented Analysis (OOA): Object Modelling, Dynamic Modelling, Functional Modelling, Main Principles of OOP, Management of OO Software Projects | This module has been designed as per BTL 3. |
12 | Web Engineering: The attributes of web based applications, WebE Characteristics, Framework for Web Application, Content Management Tool (CMT), Web Application Development Process, Software Reengineering, Reverse Engineering, Complexity of Web applications: Web crisis | This module has been designed as per BTL 3 &5 |
Textbook References: –
1. Pressman R.S., “Software Engineering”, Tata McGraw Hill Publishing Company Ltd., New Delhi. 2. Sommerville, Ian “Software Engineering”, Pearson Education Other References: 1. Jalote Pankaj, “An Integrated Approach to Software Engineering”, NAROSA. 2. Fairely, R.E., “Software Engineering Concepts”, McGraw-Hill |
(Bloom’s Taxonomy: BT level 1: Remembering; BT level 2: Understanding; BT level 3: Applying; BT level 4: Analyzing; BT level 5: Evaluating; BT level 6: Creating)