Skip to content

A Repository for storing all the Programs made during the Object Oriented Programming with Java Lab Sessions @ USCI, Karnavati University.

License

Notifications You must be signed in to change notification settings

YashWadhvani/JavaProgramsSem4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

JavaProgramsSem4

A repository containing all Java programs developed during Object Oriented Programming with Java Lab Sessions at Unitedworld School of Computational Intelligence (USCI), Karnavati University.


📚 Overview

This repository serves as a resource for practicing and revising core Java concepts, OOP principles, and exception handling, along with some real-world problem-solving using Java. Each program is designed to help students solidify their understanding of Java programming.


📝 List of Programs

🧑‍💻 Basic Programs

  1. Print "Hello World! This is my First Java Program."
  2. Perform arithmetic operations (+, −, ×, ÷) on two numbers.
  3. Find the greatest of three entered numbers.
  4. Find the lowest of three entered numbers.
  5. Check whether a number is odd or even.
  6. Convert distance from KM to Miles and vice versa.
  7. Convert temperature from Celsius to Fahrenheit and vice versa.
  8. Print the Fibonacci sequence up to n terms.
  9. Compare two floating-point numbers up to three decimal places.
  10. Identify if the entered character is a vowel or consonant with error handling for invalid input.
  11. Check if a year is a leap year.
  12. Display the first 10 natural numbers.
  13. Display the multiplication table for a given number.

🔢 Patterns

  1. Print a triangle pattern with repeating numbers:
    1
    22
    333
    4444
    
  2. Print a triangle pattern with incremented numbers:
    1
    2 3
    4 5 6
    7 8 9 10
    

👨‍🏫 Object-Oriented Programs

  1. Add two numbers using class and object.
  2. Create a Student class with marks for 3 subjects, calculate average.
  3. Implement single inheritance using Person and Employee classes.
  4. Create a class hierarchy with a base class Shape, and derived classes Circle, Rectangle, and Triangle. Implement area() and perimeter() methods.
  5. Develop a simple online shopping system using inheritance and polymorphism.
  6. Implement BankAccount, with subclasses SavingsAccount and CheckingAccount, demonstrating method overriding.

📦 Package & Modular Java

  1. Create a bookstore management system using Java packages:
    • bookstore.book → Class: Book (title, author, ISBN, price)
    • bookstore.inventory → Class: InventoryManager (add/update stock, retrieve book details)

🔁 Loops, Recursion & Numbers

  1. Find factorial of a number.
  2. Find sum of digits of a number.

🛑 Exception Handling

  1. Handle ArithmeticException using try-catch.
  2. Handle ArrayIndexOutOfBoundsException using try-catch.
  3. Use throw keyword to create a custom exception.
  4. Use throws keyword to handle a custom exception.

🧵 Multithreading

  1. Demonstrate multithreading with count from 1 to 5 with a 1-second delay.

📦 Wrapper Classes & Built-in Methods

  1. Perform autoboxing and unboxing.
  2. Use 5 methods from the Math class.
  3. Use 5 methods from the String class.
  4. Use 5 methods from the StringBuffer class.

📁 Folder Structure

JavaProgramsSem4/
├── Program01_HelloWorld.java
├── Program02_ArithmeticOperations.java
├── ...
├── bookstore/
│   ├── book/
│   │   └── Book.java
│   └── inventory/
│       └── InventoryManager.java
└── README.md


---

## 🤝 Contributing

Contributions are welcome!  
If you’d like to improve a program, fix a bug, or add a new Java exercise, feel free to:

1. Fork the repository
2. Create a new branch (`git checkout -b feature-name`)
3. Commit your changes (`git commit -m 'Add new feature'`)
4. Push to the branch (`git push origin feature-name`)
5. Open a Pull Request

---

## 📜 License

This project is licensed under the [MIT License](LICENSE).  
Feel free to use, modify, and distribute the code with attribution.

---

## 🙌 Acknowledgments

- Java Documentation: [docs.oracle.com](https://docs.oracle.com/javase/8/docs/)
- Lab Instructors and Faculty at USCI, Karnavati University
- Open-source contributors and the Java community

---

## ✨ Author

**Yash Wadhvani**  
3rd Year B.Tech CSE Student  
Unitedworld School of Computational Intelligence (USCI), Karnavati University  
📫 [LinkedIn](https://www.linkedin.com/in/yashwadhvani/) • [GitHub](https://github.com/YashWadhvani)

About

A Repository for storing all the Programs made during the Object Oriented Programming with Java Lab Sessions @ USCI, Karnavati University.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages