Skip to content

121omprakash/Core_Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Core Java Practical Labs (CSIT725)

Welcome to the Core Java Practical Labs repository for the course CSIT725. This repository contains lab exercises designed to enhance your understanding of Java programming. Each lab consists of Pre-Lab, In-Lab, and Post-Lab sections. You can view the solution for each task by clicking on the provided button.


Table of Contents


Lab 1: Java Fundamentals

Pre-Lab Tasks

  1. Write a Java Program to print "Hello World"
    View Solution

  2. Write a Java program to compute the factorial of a number
    View Solution

In-Lab Tasks

  1. Develop Java code with 2 methods in MyFirstClass:
    a) factorial()
    b) isStrong() (Determine if a number is strong)
    View Solution

  2. Rework and modularize to a class level
    View Solution

Post-Lab Tasks

  1. Modify MyIntegerMath class to add methods:
    • countDigits()
    • isArmstrong()
      View Solution

Lab 2: Classes and Objects

Pre-Lab Tasks

  1. Design a Stock class with attributes: symbol, name, previousClosingPrice, currentPrice, and getChangePercent()
    View Solution

  2. Write a menu-driven program to perform Linear Search, Binary Search, and Bubble Sort
    View Solution

In-Lab Tasks

  1. Design a QuadraticEquation class with methods getDiscriminant(), getRoot1(), and getRoot2()
    View Solution

  2. Define a Student class with attributes Name, ID, Gender, Department
    View Solution

Post-Lab Tasks

  1. Estimate the execution time of invoking the linearSearch() method in best, average, and worst cases
    View Solution
  2. Develop a java program that read the number of rows and columns through command-line, reads the set of elements in a 2D array from console. The menu driven program must perform the following operations: a) Sum of all Elements b) Print the data in matrix form c) print the element of principal diagonal d) print the sum of elements in Principal diagonal
    View Solution

Lab 3: I/O and GUI

Pre-Lab Tasks

  1. Write a Java program that reads two integers from a file and prints their sum
    View Solution

  2. Write a Java program that reads Student ID, Name, Age, and Gender, and displays them on a user interface
    View Solution

In-Lab Tasks

  1. Develop a Java program to read from Names.txt and Address.txt and print the data in a specific format
    View Solution

  2. Create a student registration page using Swing with ID, Name, Gender, and Department fields
    View Solution

Post-Lab Tasks

  1. Develop a simple calculator to perform basic arithmetic operations using a GUI
    View Solution

Lab 4: Constructors and Overloading

Pre-Lab Tasks

  1. Write a program to demonstrate constructor overloading with at least three constructors(MyInteger class which checks odd,even,prime)
    View Solution

  2. Explain the differences between default and parameterized constructors in a class(Adding Factorial Method in MyInteger class)
    View Solution

In-Lab Tasks

  1. Write a program to implement constructor chaining within a class(Account Class)
    View Solution

  2. Demonstrate constructor overloading in inheritance with base and derived class(MyPoint Class)
    View Solution

Post-LabHere’s the continuation of the updated README.md file with Lab 4 and Lab 5 added:

Post-Lab Tasks

  1. Write a reflection on the use of constructor overloading in Java, and when to use it effectively(ATM class)
    View Solution
  2. StackOfInteger Class View Solution

Lab 5: Objects as Data Members

Pre-Lab Tasks

  1. StopWach class
    View Solution
2. **Explain the use of objects as data members in classes. Provide examples**  
   [![View Solution](https://img.shields.io/badge/View-Solution-brightgreen)](https://github.com/121omprakash/Core_Java/blob/main/Lab%205/Pre_Lab/Pre_Lab_2_Object_Data_Member_Theory.md)

### In-Lab Tasks
1. **Write a program to implement composition, using a `Department` class as a data member of an `Employee` class**  
   [![View Solution](https://img.shields.io/badge/View-Solution-brightgreen)](https://github.com/121omprakash/Core_Java/blob/main/Lab%205/In_Lab/In_Lab_1_Composition.java)

2. **Modify the program to include `Address` as a data member in the `Employee` class and demonstrate how composition works**  
   [![View Solution](https://img.shields.io/badge/View-Solution-brightgreen)](https://github.com/121omprakash/Core_Java/blob/main/Lab%205/In_Lab/In_Lab_2_Address_Employee_Composition.java)

### Post-Lab Tasks
1. **Write a reflection on how composition enhances the design of object-oriented systems**  
   [![View Solution](https://img.shields.io/badge/View-Solution-brightgreen)](https://github.com/121omprakash/Core_Java/blob/main/Lab%205/Post_Lab/Post_Lab_1_Composition_Reflection.md)

---

## How to Run the Programs

1. **Clone the repository:**
   ```bash
   git clone https://github.com/121omprakash/Core_Java.git
   cd Core_Java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages