0% found this document useful (0 votes)
47 views29 pages

MAD Project

The project report details the development of a Scientific Calculator Application as part of a diploma in Computer Engineering at Sharad Institute of Technology Polytechnic. It outlines the project's aim to create a user-friendly mobile application that performs basic arithmetic operations while teaching essential Android development skills, including UI design, event handling, and logical programming. The report also includes acknowledgments, methodology, resources used, and a brief literature review on the evolution of calculator applications.

Uploaded by

yash gavali
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)
47 views29 pages

MAD Project

The project report details the development of a Scientific Calculator Application as part of a diploma in Computer Engineering at Sharad Institute of Technology Polytechnic. It outlines the project's aim to create a user-friendly mobile application that performs basic arithmetic operations while teaching essential Android development skills, including UI design, event handling, and logical programming. The report also includes acknowledgments, methodology, resources used, and a brief literature review on the evolution of calculator applications.

Uploaded by

yash gavali
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/ 29

A

PROJECT REPORT
ON

“SCIENTIFIC CALCULATOR APPLICATION”

SUBMITTED
IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
FOR THE AWARD OF THE DIPLOMA
IN
COMPUTER ENGINEERING
BY
1. Mr. Yash Umakant Gavali
2. Mr. Suyash Rajgonda Patil
3. Mr. Vedant Prakash Chougule
4. Mr. Siddhant Shital Chougule

UNDER THE GUIDANCE OF


Mr.P.K.Karve
,Computer Engineering Department

DEPARTMENT OF COMPUTER ENGINEERING

Sharad Institute of Technology Polytechnic, Yadrav

Tal – Shirol, Dist - Kolhapur

Academic Year 2024-2025


DEPARTMENT OF COMPUTER ENGINEERING
Sharad Institute of Technology Polytechnic, Yadrav

CERTIFICATE
This is to certify that the project report entitled
“SCIENTIFIC CALCULATOR APPLICATION”
Submitted by
Mr. Yash Umakant Gavali
Mr. Suyash Rajgonda Patil
Mr. Vedant Prakash Chougule
Mr. Siddhant Shital Chougule
This is a bonafide work carried out by him under the supervision of
Mr.P.K.Karve and it is submitted towards the partial fulfillment of the
requirement of MSBTE for the award of the diploma in Computer Engineering.

Mr.P.K.Karve Mr. R. M. Patil


Project Guide HOD
Department of Computer Department of Computer
Engineering, SITP, Yadrav Engineering, SITP, Yadrav

Mr. B. S. Tashildar
Principal
Seal / Stamp of the College
SITP, Yadrav
Place: SITP, Yadrav
Date:

1
ACKNOWLEDGEMENT
It is my great pleasure to present the honour and sincere gratitude to
my guide Mr.P.K.Karve Lecturer, Dept. of Computer Engineering. Sharad
Institute of Technology, Polytechnic, Yadrav helped in joining the hands in
developing each and every steps of the project and for valuable guidance and
constant encouragement duringcompletion of project work. It was my privilege
and pleasure to work under her valuableguidance. I am indeed gratefully to him
for providing me helpful suggestions. Due to herconstant encouragement and
inspiration I could complete my project work.
I am very thankful to Principal, Sharad Institute of Technology,
Polytechnic,Yadrav. My grateful thanks to Mr. R. M. Patil Head of Computer
Engineering Department, for their valuable guidance, support and constant
encouragement. I express thanks to my family and friends for their support and
encouragement atevery stage of successful completion of the project work. My
sincere thanks to all those who have directly or indirectly helped me to carryout
the work.

Name of the candidate Roll No.

Mr. Yash Umakant Gavali. 35061


Mr. Suyash Rajgonda Patil. 35074
Mr. Vedant Prekash Chougule. 35058
Mr. Siddhant Shital Chougule 35056
INDEX

Sr.no Contents Page No


1 Brief Description, Introduction

2 Aim of project, Course Outcome Achieved

3 User Interface, Functionality

4 Literature Review, Actual Methodology Followed,


Actual Resource Used

5 Code Of Micro-Project

6 Output

7 Application , Conclusion
Micro Project Report
Title : scientific calculator application

 Brief Description-

A Calculator Application is one of the most fundamental projects in Android development,


aimed at providing users with a tool to perform basic mathematical operations. It serves as a
learning milestone for beginners, enabling them to explore essential Android components like
layouts, buttons, and event handling mechanisms. This application mimics the functionality
of a real-world calculator and emphasizes both user interface (UI) design and logical
implementation.

The user interface (UI) of a calculator app is typically designed to be intuitive and user-
friendly. It usually consists of a grid-like arrangement of buttons for numbers (0–9) and
operations (+, -, ×, ÷). Additionally, a display area, often implemented using a TextView or
EditText, is provided to show user inputs and results. Developers use XML to define this
layout, ensuring proper alignment and responsiveness across various screen sizes and
orientations. Layouts like LinearLayout or ConstraintLayout are commonly employed to
organize components effectively.

From a functional perspective, the calculator app allows users to perform basic arithmetic
operations such as addition, subtraction, multiplication, and division. Each button in the UI is
linked to a setOnClickListener in the Java or Kotlin code, which captures the user's input and
triggers the necessary calculations. The logic typically involves storing the numbers and
operators in variables, processing them when the "=" button is pressed, and displaying the
results in the designated area. For instance, the app handles user input as strings, parses them
to numbers, performs computations, and updates the UI dynamically.

 Introduction:

The Calculator Application is a fundamental project in Android development that


demonstrates the integration of user interface design with logical programming. It provides
users with an essential tool to perform basic arithmetic operations like addition, subtraction,
multiplication, and division. Developing a calculator app serves as a practical entry point for
aspiring Android developers to learn the essential building blocks of mobile application
development.

Android calculators are designed with simplicity and functionality in mind. The application
enables users to interact with a visually organized grid of buttons, simulating the experience
of using a physical calculator. This hands-on project allows developers to understand how to
design intuitive interfaces, manage user input, and implement backend logic to process
calculations. By focusing on these aspects, developers gain insights into core concepts such
as event handling, data processing, and error management.

Moreover, the project introduces developers to the Android Studio environment, where they
can work with XML for designing layouts and Java or Kotlin for coding the logic. It serves as

1
a practical exercise in combining these elements to create a cohesive, functional application.
From learning to define a responsive layout to linking UI components with their respective
actions, this project is an ideal stepping stone into the world of Android app development.

In addition to offering technical knowledge, the calculator app lays the groundwork for
exploring more advanced features, such as implementing scientific operations, memory
functions, or even voice input. Overall, it is a comprehensive learning experience that blends
creativity with problem-solving, making it a perfect starting point for those new to Android
development

 Aim of Project-
The primary aim of the Calculator Application Project in Android development is to create a
functional, user-friendly mobile application that enables users to perform basic arithmetic
operations efficiently. This project is designed to help developers understand and implement
the core concepts of Android development, making it an essential starting point for beginners.
By working on this project, developers gain practical experience in combining user interface
design, event handling, and logical programming into a cohesive application.

A significant focus of the project is on learning user interface (UI) design. The aim is to build
an intuitive and visually appealing layout that resembles a traditional calculator. Using
components like Button, TextView, and layout managers such as LinearLayout or ConstraintLayout,
developers learn how to arrange elements systematically to enhance usability. This involves
creating a responsive design that works seamlessly across different screen sizes and
orientations, ensuring a consistent user experience.

Another crucial goal is to master event handling in Android applications. The project
involves setting up click listeners for buttons to capture user inputs and map them to specific
arithmetic operations like addition, subtraction, multiplication, and division. This process
provides a solid understanding of handling user interactions and dynamically updating the UI
based on user actions.

The project also aims to help developers implement logical programming for mathematical
computations. This involves writing code to parse user inputs, store intermediate values, and
perform calculations in real-time. It encourages the use of control structures like if-else or
switch statements to handle different operations effectively. Additionally, the app incorporates
error handling mechanisms to address potential issues, such as invalid inputs or division by
zero, ensuring reliability and robustness.

Beyond the basics, the project encourages developers to explore advanced features that add
functionality and innovation to the application. These enhancements may include scientific
calculations, memory storage functions (e.g., M+, M-, MC), or customization options like
themes and color schemes. By implementing these features.

2
 Course Outcomes Achieved

1. Understanding User Interface (UI) Design Principles


The project helps developers gain a strong understanding of designing intuitive and
visually appealing user interfaces. Using XML, developers learn to arrange UI
components such as Button, TextView, and EditText systematically using layout
managers like LinearLayout, RelativeLayout, or ConstraintLayout. This fosters
skills in creating responsive designs that work seamlessly across different devices and
screen orientations.

2. Mastery of Event Handling and Interaction


By implementing button click listeners (setOnClickListener), developers achieve
proficiency in handling user interactions. This course outcome ensures that developers
can map user actions, such as tapping buttons, to corresponding operations or events
within the app, thereby enhancing their ability to build interactive applications.

3. Development of Logical Programming Skills


Writing and integrating the calculation logic is a key achievement in this project.
Developers learn to process user inputs, perform arithmetic operations dynamically, and
display results. This fosters critical thinking and problem-solving skills, as developers
implement algorithms to manage calculations, error handling (e.g., division by zero), and
edge cases effectively.

4. Understanding the Android Application Lifecycle


Through this project, developers gain practical experience with the Android application
lifecycle, learning how activities are created, resumed, paused, and destroyed. This
knowledge is crucial for building efficient and well-structured Android applications.

5. Error Handling and Debugging Proficiency


Implementing mechanisms to handle invalid inputs and debugging the application are
essential outcomes. Developers learn to identify and resolve runtime issues, ensuring the
application performs reliably under various scenarios. This improves their debugging
techniques and enhances the app's overall stability.

6. Exposure to Android Studio and Development Tools


The project provides hands-on experience with Android Studio, the primary Integrated
Development Environment (IDE) for Android development.
7.

3
 User Interface

1. Display Area
The display area acts as the output screen where user inputs and results are shown. It is
typically implemented using a TextView or EditText. Positioned at the top of the layout,
this area features a large font size for better readability, a neutral background color, and
padding for a clean and organized appearance.

2. Numeric Buttons (0–9)


Numeric buttons allow users to input numbers for calculations. They are arranged in a
grid-like structure for easy accessibility, ensuring consistency in size and alignment.
Each button is clearly labeled and is styled to match the overall theme of the application.

3. Operation Buttons (+, -, ×, ÷, =)


Operation buttons are used to perform arithmetic operations. These buttons are visually
distinct from numeric buttons, often featuring a different color or size to highlight their
importance. The "=" button is usually emphasized to indicate its function as the result
trigger.

4. Functional Buttons
Functional buttons, such as C (clear), DEL (delete), and . (decimal), enhance the app’s
usability. These buttons allow users to correct errors, reset inputs, or perform
calculations with decimal values, ensuring a comprehensive user experience.

5. Advanced Operation Buttons (Optional)


For scientific calculator versions, advanced operation buttons such as square root (√),
percentage (%), exponentiation (^), and parentheses can be added. These features expand
the application’s functionality to cater to more complex calculations.

6. Layout Design
The layout of the calculator is typically built using LinearLayout, GridLayout, or
ConstraintLayout. LinearLayout is used for stacking components vertically or
horizontally, while GridLayout is ideal for arranging buttons in a grid format.
ConstraintLayout provides flexibility for complex and responsive designs.

4
 Functionality:

1. Basic Arithmetic Operations


The core functionality of the application is to perform basic arithmetic calculations,
including addition (+), subtraction (−), multiplication (×), and division (÷). Users can
input numbers through the numeric buttons, select an operator, and view the result after
pressing the equals (=) button.

2. Real-Time Input Display


The app displays user inputs in real-time on the screen, typically in a TextView or
EditText. This feature ensures that users can see the numbers and operations they are
entering before executing a calculation.

3. Clear and Delete Options


The calculator provides functional buttons like C (clear) to reset the entire input and
DEL to delete the last character. These features allow users to correct mistakes without
having to start over, enhancing usability.

4. Decimal Point Support


The app includes a decimal (.) button for entering floating-point numbers. This
functionality allows users to perform calculations with decimal values, catering to more
precise and complex computations.

5. Error Handling
The application incorporates error-handling mechanisms to ensure reliability. For
instance:

i. Division by zero prompts an appropriate error message (e.g., "Cannot divide


by zero").
ii. Invalid inputs, such as multiple decimal points in a single number, are
restricted.

6. Chained Operations
Some calculators allow users to perform chained operations, such as 2 + 3 × 4,
without needing to press the equals button after each step. The app handles operator
precedence to provide accurate results for such sequences.

5
 LiteratureReview:

The development of a calculator application in Android serves as a cornerstone for


understanding mobile application development principles. Over the years, various studies,
frameworks, and tools have been utilized to design and implement calculator applications.
This literature review explores the evolution, methodologies, and contributions of research
and practical implementations in this area.

a. Historical Context and Evolution

The concept of calculators predates the digital age, with physical calculators laying
the foundation for computational tools. As technology advanced, the transition to
software-based calculators became inevitable. Early mobile applications, including
calculators, were simple in design but lacked the sophistication of modern user
interfaces and functionalities. Android’s rise as an open-source platform further
popularized the development of customizable and feature-rich calculators.

b. Significance of Android in Calculator Development

Android, being one of the most popular operating systems, provides an extensive
toolkit for application development. With components like TextView, Button, and
EditText, alongside layout managers such as LinearLayout and ConstraintLayout,
Android facilitates the creation of visually appealing and functional calculator apps.
Studies have highlighted how Android Studio, the integrated development
environment (IDE) for Android, simplifies the process of UI design and code
integration.

6
 Actual Methodology Followed-

1. Formation of groups.

2. Selected topic for project.

3. Prepared proposal.

4. Collection of information.

5. Started programming.

6. After doing program prepared Project report.

7
 Actual Resources Used-

SR.NO. Name of Specifications Quantity Remarks


Resources
/Material

1 Operating System Windows 10 1 Yes

2 CPU Intel (i) core i7 1 Yes

3 RAM 8GB 1 Yes

4 Software - 1 Yes

5 Browser Chrome 1 Yes

6
https://projectworlds.i
n/p ython-projects-
Websites with- source- Yes
code/hotel-
-
management-system-
python-tkinter-gui/

7 Mobile
1
Reference Books Application Yes
Development
Tech-Max
8 Other Resources Mouse, Keyboard 1 Yes

8
 Code of the Micro Project:

 Activity_Main.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D6CED6"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:orientation="horizontal">
<TextView
android:id="@+id/display"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E3DEE4"
android:textSize="85dp"
android:textColor="#000000"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/buttonDel"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="Del"
android:backgroundTint="#D30F45"
android:textColor="#F8F1FA"
android:textSize="20sp" />
<Button
android:id="@+id/buttoneql"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="Answer"
android:backgroundTint="#30D158"
android:textColor="#D9CCDC"

9
android:textSize="30sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/b1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="1"
android:backgroundTint="#000000"
android:textColor="#DCD3DD"
android:textSize="20sp" />
<Button
android:id="@+id/b2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="2"
android:backgroundTint="#000000"
android:textColor="#E8DEEA"
android:textSize="20sp" />
<Button
android:id="@+id/b3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="3"
android:backgroundTint="#000000"
android:textColor="#EDE3EF"
android:textSize="20sp" />
<Button
android:id="@+id/biv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="/"
android:backgroundTint="#3700B3"
android:textColor="#E7DFE8"
android:textSize="30sp" />

10
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/b4"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="4"
android:backgroundTint="#000000"
android:textColor="#DED5DF"
android:textSize="20sp" />
<Button
android:id="@+id/b5"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="5"
android:backgroundTint="#000000"
android:textColor="#E1DAE3"
android:textSize="20sp" />
<Button
android:id="@+id/b6"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="6"
android:backgroundTint="#000000"
android:textColor="#EAE1EC"
android:textSize="20sp" />
<Button
android:id="@+id/bsub"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="-"
android:backgroundTint="#3700B3"
android:textColor="#E9E2EA"
android:textSize="30sp" />
</LinearLayout>

11
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/b7"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="7"
android:backgroundTint="#000000"
android:textColor="#EAE1EC"
android:textSize="20sp" />
<Button
android:id="@+id/b8"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="8"
android:backgroundTint="#000000"
android:textColor="#E8DFEA"
android:textSize="20sp" />
<Button
android:id="@+id/b9"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="9"
android:backgroundTint="#000000"
android:textColor="#EBE5EC"
android:textSize="20sp" />
<Button
android:id="@+id/bmul"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="x"
android:backgroundTint="#3700B3"
android:textColor="#E8E0EA"
android:textSize="30sp" />
</LinearLayout>
<LinearLayout

12
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/bDot"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="."
android:backgroundTint="#3700B3"
android:textColor="#ECE7ED"
android:textSize="20sp" />
<Button
android:id="@+id/b0"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="0"
android:backgroundTint="#000000"
android:textColor="#ECE5ED"
android:textSize="20sp" />
<Button
android:id="@+id/BRemain"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:text="%"
android:backgroundTint="#3700B3"
android:textColor="#E3DCE4"
android:textSize="30sp" />
<Button
android:id="@+id/badd"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:layout_weight="0.25"
android:onClick="onClick"
android:text="+"
android:backgroundTint="#3700B3"
android:textColor="#F3EBF4"
android:textSize="30sp" />
</LinearLayout>
<LinearLayout

13
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:orientation="horizontal">
<Button
android:id="@+id/btnsin"
android:layout_width="133dp"
android:layout_height="75dp"
android:layout_margin="4dp"
android:backgroundTint="#3700B3"
android:text="sin"
android:textColor="@color/ffffff"
android:textSize="18sp" />
<Button
android:id="@+id/btncos"
android:layout_width="130dp"
android:layout_height="75dp"
android:layout_margin="4dp"
android:backgroundTint="#3700B3"
android:text="cos"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<Button
android:id="@+id/btntan"
android:layout_width="128dp"
android:layout_height="80dp"
android:layout_margin="4dp"
android:backgroundTint="#3700B3"
android:text="tan"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

 MainActivity.java:-
package com.yash.claculator;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.yash.claculator.R;
public class MainActivity extends AppCompatActivity {
double in1 = 0, i2 = 0 , result=0;

14
TextView edittext1;
boolean Add, Sub, Multiply, Divide, Remainder, deci , sin , cos , tan;
Button button_0, button_1, button_2, button_3, button_4, button_5, button_6, button_7,
button_8, button_9, button_Add, button_Sub, button_Mul, button_Div, button_Equ,
button_Del, button_Dot, button_Remainder, btnsin, btncos, btntan
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button_0 = (Button) findViewById(R.id.b0);
button_1 = (Button) findViewById(R.id.b1);
button_2 = (Button) findViewById(R.id.b2);
button_3 = (Button) findViewById(R.id.b3);
button_4 = (Button) findViewById(R.id.b4);
button_5 = (Button) findViewById(R.id.b5);
button_6 = (Button) findViewById(R.id.b6);
button_7 = (Button) findViewById(R.id.b7);
button_8 = (Button) findViewById(R.id.b8);
button_9 = (Button) findViewById(R.id.b9);
button_Dot = (Button) findViewById(R.id.bDot);
button_Add = (Button) findViewById(R.id.badd);
button_Sub = (Button) findViewById(R.id.bsub);
button_Mul = (Button) findViewById(R.id.bmul);
button_Div = (Button) findViewById(R.id.biv);
button_Remainder = (Button) findViewById(R.id.BRemain);
button_Del = (Button) findViewById(R.id.buttonDel);
button_Equ = (Button) findViewById(R.id.buttoneql);
edittext1=(TextView) findViewById(R.id.display);
btnsin=(Button) findViewById(R.id.btnsin);
btncos=(Button) findViewById(R.id.btncos);
btntan=(Button) findViewById(R.id.btntan);
button_1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "1");
}
});
button_2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "2");
}
});
button_3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

15
edittext1.setText(edittext1.getText() + "3");
}
});
button_4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "4");
}
});
button_5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "5");
}
});
button_6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "6");
}
});
button_7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "7");
}
});
button_8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "8");
}
});
button_9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "9");
}
});
button_0.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edittext1.setText(edittext1.getText() + "0");
}
});
btnsin.setOnClickListener(new View.OnClickListener() {
@Override

16
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
sin = true;
deci = false;
edittext1.setText(null);
}
}
});
btncos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
cos = true;
deci = false;
edittext1.setText(null);
}
}
});
btntan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
tan = true;
deci = false;
edittext1.setText(null);
}
}
});
button_Add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
Add = true;
deci = false;
edittext1.setText(null);
}
}
});
button_Sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");

17
Sub = true;
deci = false;
edittext1.setText(null);
}
}
});
button_Mul.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
Multiply = true;
deci = false;
edittext1.setText(null);
}
}
});
button_Div.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
Divide = true;
deci = false;
edittext1.setText(null);
}
}
});
button_Remainder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
Remainder = true;
deci = false;
edittext1.setText(null);
}
}
});
btnsin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (edittext1.getText().length() != 0) {
in1 = Float.parseFloat(edittext1.getText() + "");
sin = true;
deci = false;
edittext1.setText(null);

18
}
}
});
button_Equ.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Add || Sub || Multiply || Divide || Remainder || sin || cos || tan) {
i2 = Float.parseFloat(edittext1.getText() + "");
}
if (sin) {
result = Math.sin(Math.toRadians(i2));
edittext1.setText((int) result + "");
Add = false;
}
if (cos) {
result = Math.cos(Math.toRadians(i2));
edittext1.setText((int) result + "");
Add = false;
}
if (tan) {
result = Math.tan(Math.toRadians(i2));
edittext1.setText((int) result + "");
Add = false;
}
if (Add) {
edittext1.setText(in1 + i2 + "");
Add = false;
}
if (Sub) {
edittext1.setText(in1 - i2 + "");
Sub = false;
}
if (Multiply) {
edittext1.setText(in1 * i2 + "");
Multiply = false;
} if (Divide) {
edittext1.setText(in1 / i2 + "");
Divide = false;
}
if (Remainder) {
edittext1.setText(in1 % i2 + "");
Remainder = false;
}
}
});
button_Del.setOnClickListener(new View.OnClickListener() {
@Override

19
public void onClick(View v) {
edittext1.setText("");
in1 = 0.0;
i2 = 0.0;
}
});
button_Dot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (deci) {
//do nothing or you can show the error
} else {
edittext1.setText(edittext1.getText() + ".");
deci = true;
}
}
});
}
}

20
 Outputs of the Micro Projects:-

21
22
 kill Developed/Learning out of this Project-
1. Android UI Design Skills

2. Java and Kotlin Programming Skills

3. Mathematical Logic Implementation

4. Handling User Input and Output

5. Responsive Design and Layout Adjustments

6. Error-Free Calculations and Debugging

 Applications of this Project-

Basic Arithmetic Calculations:- The primary application is to perform everyday


arithmetic calculations such as addition, subtraction, multiplication, and division. This
is useful for general users who need to solve quick mathematical problems on their
Android devices.

Educational Tools:- The calculator app can be used as an educational tool in


teaching mathematics. It provides students with an easy way to perform calculations
and understand basic mathematical operations. Teachers can use it in classrooms to
demonstrate concepts and solve problems interactively.

Scientific Calculations (Advanced Use):- With advanced features like square roots,
exponents, trigonometric functions, and logarithms, the app can be used for scientific
purposes. This is helpful for students, engineers, and professionals in fields like
physics, chemistry, and mathematics.

Finance and Accounting:- The calculator app can be extended to handle more
complex calculations in finance, such as calculating interest rates, loans, or profit

23
margins. It can also be used for basic accounting tasks like summing expenses or
calculating taxes.

Engineering and Architecture:- Professionals in engineering and architecture may


use the calculator app to perform quick calculations related to measurements,
conversions, and geometric formulas. This can be especially helpful when working
on-site or without access to more complex software.

Health and Fitness:- A calculator app can be customized to calculate Body Mass
Index (BMI), calorie intake, or workout parameters like distance, time, and speed.
Health-conscious users can use the app to monitor their fitness goals.

Business Applications:- Small business owners can use the calculator to perform
quick price calculations, track sales, or manage inventory numbers. A more advanced
version can help in generating invoices or calculating payroll.

Accessibility for People with Disabilities:- Custom features such as voice


commands or screen readers can make the calculator accessible for individuals with
disabilities. Users with visual impairments could rely on speech-to-text or voice
commands to input numbers and get results.

 Reference

 www.google.com

 www.chatgpt.com

 www.wikipedia.org

 www.geeksforgeeks.org/types-of-hacking/

24
 Conclusion
The development of a calculator application in Android is a comprehensive project that
covers various aspects of mobile app development, including UI/UX design, programming
logic, error handling, and testing. This project serves as a practical example of how basic
functionality can be implemented effectively within a mobile app framework, making it an
essential tool for developers, students, and professionals.

The calculator app, while simple, offers valuable learning experiences, particularly in
handling user input, managing UI components, and integrating mathematical functions. By
using Android’s native tools like TextView, Button, and layout managers like GridLayout
and LinearLayout, developers can create intuitive, efficient, and responsive user interfaces
that cater to different device screen sizes and orientations.

Furthermore, this project allows developers to explore advanced features such as error
handling, input validation, and the integration of additional functionalities like scientific
calculations or memory operations. The skills gained from this project can be applied to more
complex applications, serving as a stepping stone to more advanced Android app
development.

25

You might also like