Skip to main content

Arithmetic calculator Java


 Arithmetic calculator.
G.U.I

Coding for add button:
int num1=Integer.parseInt(tf1.getText());
int num2=Integer.parseInt(tf2.getText());
int result=num1+num2;
tf3.setText(""+result); }
coding for subtract button:
int num1=Integer.parseInt(tf1.getText());
int num2=Integer.parseInt(tf2.getText());
int result=num1-num2;
tf3.setText(""+result);
coding for multiply button:
int num1=Integer.parseInt(tf1.getText());
int num2=Integer.parseInt(tf2.getText());
int result=num1*num2;
tf3.setText(""+result);
coding for division button:
int num1=Integer.parseInt(tf1.getText());
int num2=Integer.parseInt(tf2.getText());
int result=num1/num2;
tf3.setText(""+result);
coding for clear button:
tf1.setText("");
tf2.setText("");
tf3.setText("");
coding for exit button :
System.exit(0);




Run time screenshot:












Popular posts from this blog

Sudo - SuperUser Access TERMUX

Sudo works on only rooted devices   sudo means superuser & root command we can run root tools in termux using sudo Execute these commands one by one to install sudo. Installation : $ apt update  $ apt upgrade $ apt install git $ apt install tsu $ apt install ncurses-utils $ git clone https://github.com/termux-sudo $ cd termux-sud $ cat sudo > /data/data/com.termux/files/usr/bin/sudo $ chmod 700 /data/data/com.termux/files/usr/bin/sudo sudo su sudo tsu Now you are a root user..

Termux Login Script

Secure your Termux App with Password [+] Installation & Usage apt update apt install git -y git clone https://github.com/htr-tech/termux-login.git cd termux-login chmod +x * sh install.sh exit  or use Single Command apt update && apt install git -y && git clone https://github.com/htr-tech/termux-login.git && cd termux-login && chmod +x * && sh install.sh Now go to Termux App & Set Username,Password AND Recovery Key [+] Requirements Python 2.x [+] Features : • Bug Fixed • Parrot typing Shell Added CREDITS : https://github.com/Udoy2/  https://github.com/TechnicalMujeeb/  [+] Find Me on : Instagram : @tahmid.rayat Facebook : tahmid.rayat.official Github : htr-tech