First, project name: subtraction arithmetic
Second, design ideas:
1.enter two numbers in the dialog box and convert to int type
2, carry out subtraction arithmetic
3. Output results
Third, flow chart
Iv. Source Code
Import Javax.swing.JOptionPane;
public class Sizeyunsuan {
public static void Main (string[] args) {
TODO auto-generated method stubs
int N1=integer.parseint (Joptionpane.showinputdialog ("Input number 1:"));
int N2=integer.parseint (Joptionpane.showinputdialog ("Input number 2:"));
Gets the value entered from the Joptionpane.showinputdialog dialog box and then converts to the int type
Joptionpane.showmessagedialog (NULL, "The sum is:" + (N1+N2)
+ "\ n" + "The difference is:" + (N1-N2)
+ "\ n" + "The product is:" + (N1*N2)
+ "\ n" + "the Division is:" + (N1/N2));
}
}
Five
One
Two
Three
Vi. Summary
The focus is on the conversion of characters
Java Program complete Subtraction arithmetic