0% found this document useful (0 votes)
10 views17 pages

MAD Microproject

The document is a micro project report on the 'Study of Concept, Principles and Function of Management' and details the development of a Calculator mobile application using Java and XML. It outlines the project's objectives, technologies used, and provides an overview of the application's functionality, including basic arithmetic operations and user interface design. The report includes sections on the project diary, code snippets, and references for further learning.

Uploaded by

gavalimanasi1
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)
10 views17 pages

MAD Microproject

The document is a micro project report on the 'Study of Concept, Principles and Function of Management' and details the development of a Calculator mobile application using Java and XML. It outlines the project's objectives, technologies used, and provides an overview of the application's functionality, including basic arithmetic operations and user interface design. The report includes sections on the project diary, code snippets, and references for further learning.

Uploaded by

gavalimanasi1
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/ 17

MICRO PROJECT REPORT ON

“Study of Concept, Principles and Function of Management”

SUBMITTED BY –

Sr. No. Name of Student Roll No.


1 Rushikesh Potdar 36

2 Apoorva Irabatti 44

3 Manasi Gavali 46

UNDER THE GUIDANCE OF


Mr.S.S.Jamadar

DEPARTMENT OF COMPUTER SCIENCE &


ENGINEERING SANJAY GHODAWAT
INSTITUTE, ATIGRE ACADEMIC YEAR:
2024-25
Certificate
This is to certify that the Micro project work entitled

“Study of Concept, Principles and Function of Management”

Has been successfully completed by

In fulfillment for the

Diploma in Computer Science &Engineering

Maharashtra State Board of Technical Education

During the academic year 2024-25 under the guidance of

Mr. S.S.Jamadar Mr. S. V. Chavan


Project Guide H.O. D

Dr.V.V. Giri
Principal
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
Program Code – CW-6-I

Course Name –MAD

Course Code – 22617


Project Title -

“Calculator”

Micro
Sr. Roll Enrollment No. Exam
Name of Student Project Total
No. No. Seat No.
Marks

G I 6+4 =10

1 36 Rushikesh Potdar 2216440382

2 44 Apoorva Irabatti 2216440390

3 46 Manasi Gavali 2216440392

Mr.S.S.Jamadar

Course Faculty &Signature


Program Name – Computer Science & Engineering Program Code – CW-6-I

Course Name – MAD Course Code – 22617

Project Title - Calculator

Course Outcomes (CO), Practical Outcomes (PRO’s) and Unit Outcomes (UOs)
Mapping

PRO’s
Cos Mapping UOs
PRO’s.
MICRO PROJECT DIARY

Sr.
From Date to Date Activity Performed
No.

1 2 Jan- 3 Jan 2025 Introduction

2 10 Jan -15 Jan 2025

22 Jan – 30 Jan 2025


3
4 2 Feb – 10 Feb 2025

5 15 Feb – 28 Feb 2025

6 2 Mar 2025 Conclusion

7 13 Mar 2025 References

8 Submitted date
INDEX

Page
Sr.
No. CONTENT No.

1 Abstract 1

2 Introduction 2

3 Tags used in XML Layout 3

4 Technologies used 3

5 Working of Application 4

6 Code 5-8

Output 9

6 Conclusion 10

7 Reference 11
Calculator

ABSTRACT

The Calculator Mobile Application is a simple yet functional Android-based project developed using Java
and XML. The application provides basic arithmetic operations such as addition, subtraction, multiplication,
and division. It features a user-friendly interface where users can input numbers and perform calculations
with a single tap. This project is designed to demonstrate Android development fundamentals, UI design,
and event handling in mobile applications.

1
Calculator

INTRODUCTION

Calculators are essential tools in everyday life, helping users perform quick mathematical computation. The
Calculator Mobile Application is a simple Android-based project designed to perform basic arithmetic
operations such as addition, subtraction, multiplication, and division. The app features a user-friendly
interface with a numeric keypad and functional buttons, allowing users to perform quick calculations
efficiently.

Developed using Java and XML, the project demonstrates key Android development concepts, including
UI design, event handling, and data processing. The application uses onClickListener to handle button
clicks, updating the display in real time. This project serves as a foundational learning experience for
beginners in Android development, providing insights into mobile UI structuring and interactive
programming.

2
Calculator

Tags Used in XML Layout


1. <RelativeLayout> – Main Layout
• This is a flexible layout that allows positioning of elements relative to each other or the
parent layout.
• It is used as the main container to hold all UI elements.
2. <EditText> – Display for Numbers and Results
• This is an input field where users can see the numbers they enter and the calculation
results.
• Typically, it is set to read-only (android:focusable="false") to prevent manual input and
ensure only button clicks modify its content.
3. <Button> – Digits and Arithmetic Operations
• Buttons are used for numbers (0-9) and arithmetic operations (+, -, ×, ÷, =, C).
• Each button has an onClick event to process user input.
4. <GridLayout> – Button Organization
• This layout arranges buttons in a grid format (e.g., 4x4 for a standard calculator).
It ensures proper alignment and spacing, making the UI structured and easy to use.

Technologies Used
• Programming Language: Java

• XML Layout Design: UI components

• Android SDK: For building and running the app

• Android Studio: IDE for development

• Event Handling: onClickListener for button interactions

3
Calculator

Working of the Application

User Input: The user enters numbers using the numeric buttons.

Operation Selection: The user selects an arithmetic operation (e.g., +, -, *, /).

Processing: The application processes the input and performs the calculation.

Display Result: The calculated result is displayed in the text field.

Clearing Functionality: Users can reset the calculator using the "C" button.

4
Calculator

XML Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<EditText
android:id="@+id/display" android:layout_width="match_parent"
android:layout_height="wrap_content" android:textSize="30sp"
android:gravity="right" android:inputType="none"
android:layout_alignParentTop="true" android:padding="20dp" />

<GridLayout
android:id="@+id/gridLayout" android:layout_width="match_parent"
android:layout_below="@id/display" android:layout_alignParentBottom="true"
android:columnCount="4" android:layout_height="wrap_content">

<Button
android:id="@+id/button1"
android:text="1" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button2"
android:text="2" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button3" android:text="3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonAdd" android:text="+"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button4" android:text="4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button5" android:text="5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button6" android:text="6"

5
Calculator
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonSubtract" android:text="-"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/button7" android:text="7"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button8" android:text="8"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button9" android:text="9"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonMultiply" android:text="*"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button0" android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonClear" android:text="C"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonEquals" android:text="="
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/buttonDivide" android:text="/"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</GridLayout>

</RelativeLayout>

6
Calculator

JAVA Code

package com.checkbox.calculator
import android.annotation.SuppressLint;
import android.os.Bundle; import
android.widget.Button; import
android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

private EditText display;


private Double operand1 = null;
private String operator = null;
private boolean isOperatorClicked = false;

@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

display = findViewById(R.id.display);

Button button1 = findViewById(R.id.button1); Button button2 =


findViewById(R.id.button2); Button button3 = findViewById(R.id.button3);
Button button4 = findViewById(R.id.button4); Button button5 =
findViewById(R.id.button5); Button button6 = findViewById(R.id.button6);
Button button7 = findViewById(R.id.button7); Button button8 =
findViewById(R.id.button8); Button button9 = findViewById(R.id.button9);
Button button0 = findViewById(R.id.button0);

Button buttonAdd = findViewById(R.id.buttonAdd);


Button buttonSubtract = findViewById(R.id.buttonSubtract); Button buttonMultiply =
findViewById(R.id.buttonMultiply); Button buttonDivide = findViewById(R.id.buttonDivide);

Button buttonClear = findViewById(R.id.buttonClear); Button buttonEquals =


findViewById(R.id.buttonEquals);

button1.setOnClickListener(v -> onNumberClick("1")); button2.setOnClickListener(v ->


onNumberClick("2")); button3.setOnClickListener(v -> onNumberClick("3"));
button4.setOnClickListener(v -> onNumberClick("4")); button5.setOnClickListener(v ->
onNumberClick("5")); button6.setOnClickListener(v -> onNumberClick("6"));
button7.setOnClickListener(v -> onNumberClick("7")); button8.setOnClickListener(v ->
onNumberClick("8"));
button9.setOnClickListener(v -> onNumberClick("9")); button0.setOnClickListener(v ->
onNumberClick("0"));buttonAdd.setOnClickListener(v -> onOperatorClick("+"));
7
Calculator
buttonSubtract.setOnClickListener(v -> onOperatorClick("-")); buttonMultiply.setOnClickListener(v ->
onOperatorClick("*")); buttonDivide.setOnClickListener(v -> onOperatorClick("/"));

buttonClear.setOnClickListener(v -> onClearClick()); buttonEquals.setOnClickListener(v


-> onEqualsClick());
}

// Handle number button click @SuppressLint("SetTextI18n")


private void onNumberClick(String number) {
String currentText = display.getText().toString(); if (isOperatorClicked) {
display.setText(number); isOperatorClicked =
false;
} else {
display.setText(currentText + number);
}
}
private void onOperatorClick(String operator) {
operand1 = Double.parseDouble(display.getText().toString()); this.operator = operator;
isOperatorClicked = true;
}

// Handle the "Clear" button click private void


onClearClick() {
display.setText(""); operand1 = null; operator =
null;
isOperatorClicked = false;
}

private void onEqualsClick() {


Double operand2 = Double.parseDouble(display.getText().toString()); Double result = null;

if (operator != null) {
switch (operator) { case "+":
result = operand1 + operand2; break;
case "-":
result = operand1 - operand2; break;
case "*":
result = operand1 * operand2; break;
case "/":
if (operand2 != 0) {
result = operand1 / operand2;
} // Handle division by zero

break;
}
}

display.setText(result != null ? result.toString() : "Error"); operand1 = result;

operator = null; // Reset the operator after the calculation


}
}

8
Calculator

Output:

Addition of numbers

9
Calculator

CONCLUSION
.
The Calculator Mobile Application is a simple yet effective demonstration of Android
development. It helps users perform basic calculations while giving developers a hands-on
experience in UI design, event handling, and mobile application logic. The project can be further
enhanced by adding advanced mathematical functions, memory storage, and a scientific mode.

10
Calculator

1. REFERENCES

• https://www.w3schools.com/xml/
• https://www.geeksforgeeks.org/how-to-build-a-simple-calculator-app-using-android-studio/
• https://www.programiz.com/java-programming/examples/calculator-case

11

You might also like