0% found this document useful (0 votes)
7 views4 pages

Java glob pdf

it’s a very good Java globe super the Google bar did
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Java glob pdf

it’s a very good Java globe super the Google bar did
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Here's the Java code

import java.util.Scanner;

public class SimpleCalculator {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.print("Enter first number: ");


double num1 = scanner.nextDouble();

System.out.print("Enter second number: ");


double num2 = scanner.nextDouble();

System.out.print("Enter an operator (+, -, *, /): ");


char operator = scanner.next().charAt(0);

double result;

switch (operator) {
case '+':
result = num1 + num2;
break;
case '-':
result = num1 - num2;
break;
case '*':
result = num1 * num2;
break;
case '/':
if (num2 == 0) {
System.out.println("Error: Division by zero");
return;
}
result = num1 / num2;
break;
default:
System.out.println("Invalid operator");
return;
}

System.out.println(num1 + " " + operator + " " + num2 + " = "


+ result);
}
}

And here's the project report structure


1. Cover Page & Title Page
● Project Title: Simple Calculator
● Your Name: P Maheshwar Babu, G jayanth,s Abhishek,M vivek
● Roll Number/ID: 23241A67B4,23241A6779,23241A67C6,23241A67A8
● Department: DATA SCIENCE
● Institution: GOKARAJU RANGARAJ INSTITUTE OF ENGINEERING AND
TECHNOLOGY
2. Certificate
● (Obtain this from your guide/supervisor)
3. Abstract
This project implements a basic calculator program in Java. The calculator performs arithmetic
operations such as addition, subtraction, multiplication, and division on two numbers input by
the user. The program utilizes a Scanner class for user input and a switch statement to handle
different operators. This project serves as a foundational exercise in Java programming,
demonstrating core concepts like input/output handling, basic arithmetic operations, and control
flow.
4. Table of Contents
Chapter No. Chapter Name Page No.
1 INTRODUCTION
1.1 Introduction to the Project
Work
1.2 Significance of the Project
2 LITERATURE SURVEY
2.1 Existing Approaches
2.2 Drawbacks of Existing
Approaches
3 PROPOSED METHOD
3.1 Problem Statement
3.2 Objectives of the Project
3.3 Explanation of Architecture
Diagram
3.4 Software and Hardware
Requirements
3.5 Modules Connectivity
Diagram and its Description
4 RESULTS AND DISCUSSIONS
4.1 Description about Dataset
4.2 Detailed explanation about
the Experimental Results
5 CONCLUSION AND FUTURE
ENHANCEMENTS
5.1 Conclusion
5.2 Future Enhancement
6 REFERENCES
5. List of Figures
(List any figures with their titles and page numbers here)
6. List of Tables
(List any tables with their titles and page numbers here)
7. List of Symbols, Abbreviations (if any)
(None for this project)
8. INTRODUCTION
8.1 Introduction to the Project Work (Rationale / Motivation)
This project aims to develop a simple calculator application using Java. Calculators are
essential tools used in various fields, from everyday life to complex scientific calculations. This
project provides a basic understanding of Java programming concepts and the development of
a user-friendly interface for performing arithmetic operations.
8.2 Significance of the Project
● Educational Value: This project serves as a practical exercise for beginners in Java
programming, reinforcing fundamental concepts like variables, data types, operators,
control flow, and input/output handling.
● Foundation for Complex Applications: Building a simple calculator lays the groundwork
for developing more complex applications, such as scientific calculators, financial
calculators, or even graphical calculators.
● Understanding User Interface Design: It introduces the concept of designing a user
interface (UI) to ensure the application is intuitive and easy to use.
9. LITERATURE SURVEY
(You'll need to add content here based on your research. Here are some potential areas
to explore):
● 2.1 Existing Approaches:
○ Discuss different types of calculators (basic, scientific, graphing).
○ Explore various UI design approaches for calculator applications.
○ Research different programming languages and libraries used for calculator
development.
● 2.2 Drawbacks of Existing Approaches:
○ Limitations of basic calculators in handling complex functions.
○ Usability issues in some calculator interfaces.
○ Performance challenges in certain calculator applications.
10. PROPOSED METHOD
10.1 Problem Statement
To design and implement a simple calculator program in Java that can perform basic arithmetic
operations (addition, subtraction, multiplication, and division) on two numbers provided by the
user.
10.2 Objectives of the Project
● Develop a Java program that takes two numbers and an operator as input from the user.
● Implement the four basic arithmetic operations: addition, subtraction, multiplication, and
division.
● Handle potential errors like division by zero.
● Display the result of the calculation to the user.
● Ensure the program is user-friendly and easy to understand.
10.3 Explanation of: Architecture Diagram
(Include a simple diagram showing the input, processing, and output flow of the calculator)
10.4 Software and Hardware Requirements
● Software:
○ Java Development Kit (JDK)
○ Text editor or IDE (Integrated Development Environment)
● Hardware:
○ Any computer with sufficient memory and processing power to run Java
applications.
10.5 Modules Connectivity Diagram and its Description
(For this simple calculator, you might not have distinct modules. You can describe the flow of the
program instead.)
11. RESULTS AND DISCUSSIONS
11.1 Description about Dataset
(Not applicable for this project as there's no specific dataset used.)
11.2 Detailed explanation about the Experimental Results (using Graphs, Screen Shots)
● Include screenshots of the calculator program running and performing different
calculations.
● If you have conducted any performance tests, you can present the results using graphs or
tables.
12. CONCLUSION AND FUTURE ENHANCEMENTS
12.1 Conclusion
● Summarize the successful implementation of the simple calculator in Java.
● Highlight the achievement of project objectives.
● Mention the key learnings from the project.
12.2 Future Enhancement
● Adding more advanced functions (e.g., square root, trigonometric functions).
● Implementing a graphical user interface (GUI) for a more visually appealing calculator.
● Extending the calculator to handle more complex mathematical expressions.
13. REFERENCES
(Include a list of at least 15 references relevant to Java programming, calculator applications,
and any specific concepts you've explored in your project.)
● https://codebaji.com/program-of-simple-calculator-using-switch/
● https://universityadmission2023.in/calculator-program-in-java/
● https://electro4u.net/blog/write-a-program-for-basic-calculator-operation-using-command-li
ne-in-c-616
● https://github.com/YaminLamBappi/Calculator-In-Java

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy