Skip to content

Kush05Bhardwaj/Java-Assignment2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Java Programming Assignment 2

Calculator Application – Using Method Overloading

Name: Kushagra Bhardwaj
Roll No.: 2401010029
Course: Java Programming
Programme: B.Tech CSE Core
Session: 2025-26


Project Description

This project is a console-based Calculator Application developed in Java.
It demonstrates the concept of method overloading by performing arithmetic operations with different data types and parameter combinations.
The program features a menu-driven interface that allows users to perform addition, subtraction, multiplication, and division operations efficiently while handling invalid inputs and exceptions gracefully.


Objectives

  • To implement and demonstrate method overloading in Java.
  • To design a simple, interactive menu-driven calculator application.
  • To handle exceptions such as divide-by-zero errors effectively.
  • To reinforce understanding of object-oriented programming concepts and control structures.

Features

  • Overloaded Methods: Demonstrates method overloading with add() methods accepting different parameter types and counts.
  • Arithmetic Operations: Supports addition, subtraction, multiplication, and division.
  • Exception Handling: Safely manages invalid inputs and division by zero using try-catch.
  • User Interaction: Menu-driven interface for smooth navigation.
  • Input Validation: Prevents crashes from wrong data entries (non-numeric inputs).

Technologies Used

  • Language: Java
  • IDE/Editor: Visual Studio Code (or any Java-supported IDE)
  • Execution Environment: Java JDK

Sample Output

=== Calculator Application ===
1. Add Numbers
2. Subtract Numbers
3. Multiply Numbers
4. Divide Numbers
5. Exit
Enter your choice: 1
Choose Addition Type:
1. Add two integers
2. Add two doubles
3. Add three integers
Enter your choice: 1
Enter first integer: 10
Enter second integer: 20
Result: 30

About

Java Assignments (for college internals)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages