2nd Semester MCA (2022) Lab Program codes.
- Define a class ‘product’ with data members pcode, pname and price. Create 3 objects of the class and find the product having the lowest price.
- Read 2 matrices from the console and perform matrix addition.
- Add complex numbers
- Read a matrix from the console and check whether it is symmetric or not.
- Create CPU with attribute price. Create inner class Processor (no. of cores, manufacturer) and static nested class RAM (memory, manufacturer). Create an object of CPU and print information of Processor and RAM.
- Program to Sort strings
- Search an element in an array.
- Perform string manipulations
- Program to create a class for Employee having attributes eNo, eName eSalary. Read n employ information and Search for an employee given eNo, using the concept of Array of Objects.
- Area of different shapes using overloaded functions
- Create a class ‘Employee’ with data members Empid, Name, Salary, Address and constructors to initialize the data members. Create another class ‘Teacher’ that inherit the properties of class employee and contain its own data members department, Subjects taught and constructors to initialize these data members and also include display function to display all the data members. Use array of objects to display details of N teachers.
- Create a class ‘Person’ with data members Name, Gender, Address, Age and a constructor to initialize the data members and another class ‘Employee’ that inherits the properties of class Person and also contains its own data members like Empid, Company_name, Qualification, Salary and its own constructor. Create another class ‘Teacher’ that inherits the properties of class Employee and contains its own data members like Subject, Department Teacherid and also contain constructors and methods to display the data members. Use array of objects to display details of N teachers.
- Write a program has class Publisher, Book, Literature and Fiction. Read the information and print the details of books from either the category, using inheritance.
- Create classes Student and Sports. Create another class Result inherited from Student and Sports. Display the academic and sports score of a student.
- Create an interface having prototypes of functions area() and perimeter(). Create two classes Circle and Rectangle which implements the above interface. Create a menu driven program to find area and perimeter of objects.
- Prepare bill with the given format using calculate method from interface.
- Create a Graphics package that has classes and interfaces for figures Rectangle, Triangle, Square and Circle. Test the package by finding the area of these figures.
- Create an Arithmetic package that has classes and interfaces for the 4 basic arithmetic operations. Test the package by implementing all operations on two given numbers
- Write a user defined exception class to authenticate the user name and password.
- Find the average of N positive integers, raising a user defined exception for each negative input.
- Define 2 classes; one for generating multiplication table of 5 and other for displaying first N prime numbers. Implement using threads. (Thread class)
- Define 2 classes; one for generating Fibonacci numbers and other for displaying even numbers in a given range. Implement using threads. (Runnable Interface)
- Producer/Consumer using ITC
- Program to create a generic stack and do the Push and Pop operations.
- Using generic method perform Bubble sort.
- Maintain a list of Strings using ArrayList from collection framework, perform built-in operations.
- Program to remove all the elements from a linked list
- Program to remove an object from the Stack when the position is passed as parameter
- Program to demonstrate the creation of queue object using the PriorityQueue class
- Program to demonstrate the addition and deletion of elements in deque
- Program to demonstrate the creation of Set object using the LinkedHashset class
- Write a Java program to compare two hash set
- Program to demonstrate the working of Map interface by adding, changing and removing elements.
- Program to Convert HashMap to TreeMap
- Program to draw Circle, Rectangle, Line in Applet.
- Program to find maximum of three numbers using AWT.
- Find the percentage of marks obtained by a student in 5 subjects. Display a happy face if he secures above 50% or a sad face if otherwise.
- Using 2D graphics commands in an Applet, construct a house. On mouse click event, change the color of the door from blue to red.
- Implement a simple calculator using AWT components.
- Develop a program that has a Choice component which contains the names of shapes such as rectangle, triangle, square and circle. Draw the corresponding shapes for given parameters as per user’s choice.
- Develop a program to handle all mouse events and window events
- Develop a program to handle Key events.
- Program to list the sub directories and files in a given directory and also search for a file name.
- Write a program to write to a file, then read from the file and display the contents on the console.
- Write a program to copy one file to another.
- Write a program that reads from a file having integers. Copy even numbers and odd numbers to separate files.
- Client server communication using Socket – TCP/IP
- Client Server communication using DatagramSocket - UDP