Aim:
Write a program to perform basic arithmetic operations using a calculator.
Process
In this practical, it has been performed the basic arithmetic operation like addition, subtraction, multiplication and division.
UI Design (input field & buttons)
For this it has taken two text input fields( which is also known as edit text) by which the user can put their number to calculate.
Drag four different buttons to perform the addition, subtraction, multiplication and division in the activity_main.xml file.
Project ( MySeconApp) >> app >> res >> layout >> activity_main.xml
Define element appear text
For button it has been defined the text in the String.xml file
Project ( MySeconApp) >> app >> res >> values >> string.xml
Define the methods the code
Then define the methods and code expression within the MainActivity.java
Project ( MySeconApp) >> app >> java >> com.example.mysecondapp >> MainActivity.
Code:
MainActivity.java
strings.xml
activity_main.xml


.png)
.png)