Posts

Showing posts from August, 2019

Python program to add two numbers

Python program to add two numbers Given- two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers. Examples: Input: num1 = 5, num2 = 3 Output: 8 Input: num1 = 13, num2 = 6 Output: 19 In the below program to add two numbers, the user is first asked to enter two numbers and the input is scanned using the input() function and stored in the variables number1 and number2. Then, the variables number1 and number2 are added using the arithmetic operator + and the result is stored in the variable sum. Below is the Python program to add two numbers: Example 1: # Python3 program to add two numbers     num1 = 15 num2 = 12     # Adding two nos sum = num1 + num2     # printing values print ( "Sum of {0} and {1} is {2}" . format (num1, num2, sum )) Output: Sum of 15 and 12 is 27

Finding whether the number is odd or even and positive or negative.

Image
 finding whether the number is odd or even and positive or negative. g.u.i: coding for even or odd: { int NUM=Integer.parseInt(tf1.getText()); if(NUM%2==0) tf2.setText("Even"); else tf2.setText("Odd"); } coding for positive or negative: { int NUM=Integer.parseInt(tf1.getText()); if(NUM>0) tf3.setText("Positive"); else tf3.setText("Negative"); } coding for clear button: { tf1.setText(""); tf2.setText(""); tf3.setText(""); } coding for exit button: { System.exit(0); } Run time screenshot:

Arithmetic calculator Java

Image
 A rithmetic 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:

JAVA CODE FOR PIZZACAFE

Image
                     code for pizza cafe of netbeans (java) DECLARE VARIABLES AS.... TEXT FIELD  -tf1,tf2,tf3 etc... radiobutton -rb1,rb2,rb3 etc... CHECK BOX-cb1,cb2,cb3.. don't forget to add button group to radiobutton and selecting button group 1 on properties of buttongroup on both radiobutton select buttongroup1 ON TEXTFEILD OF RATE ,COST OF TOPPING, AMOUNT SET  tf3.setEditable(false); tf4.setEditable(false); tf5.setEditable(false); code for rate button int q=Integer.parseInt(tf2.getText()); int rate; if(rb1.isSelected()) {   rate=q*100;   tf3.setText(" "+rate); }else     {rate=q*500;  tf3.setText(""+rate); code for amount button int t = 0; if(ch1.isSelected())     t=t+45; else     if(ch2.isSelected())         t=t+55;     else         if(ch3.isSelected())             t=t+65; tf4.setText(" "+t); code for order button String name=tf1.getText();         JOptionP

Python script to convert video files to mp3 audio files

Python script to convert video files to mp3 audio files A python script to convert video files into mp3 audio files. As a heavy listener of music, I prefer keeping audio files on my phone than video files to consume less disk space. This tool helps in converting the video files present in my computer to mp3 audio files. Requirements: This script needs Python 3+ If you don't have Python 3 installed, you just need to install python3 package : $ sudo apt-get install python3 Clone: $ git clone https://github.com/adityashrm21/Video-to-audio-converter $ cd ../Video-to-audio-converter Usage: $ python3 video_to_audio.py <filename> Enjoy.... 😊😊

A Script For Install Kali-linux On Termux.

A Script For Install Kali-linux On Termux. How to Use ? or Installation :  git clone https://github.com/Techzindia/Kali-linux_For_Termux     cd Kali-linux_For_Termux   cp Kali-linux-Termux $HOME   cd $HOME   chmod +x Kali-linux-Termux   ./Kali-linux-Termux Don't Clone In Internal/External Storage 😊😊Enjoy...