1024programmer Java Java addition, subtraction, multiplication and division problems

Java addition, subtraction, multiplication and division problems

package a;

import java.text.DecimalFormat;

public class bb {
public static void main(String[] args) { 

public static void operation() {
                                                                                                                                                                                        int) (Math.random( ) * 4);                                                                                                                                                                                                                                                                                                                   int b = (int) (Math.random() * 100) ;                                                                                                                                                                                                                                                                                          . “+a + “+” + b + “=” + (a + b));
               break;                                                       //Subtraction
System.out.println(” “);< ;                                                                                                                              System.out.println(" ");
System.out.println( i + “. “+a + “*” + b + “=” + (a * b));
break;
case 3:
if (b == 0) {// If b = 0 is calculated
I-;
Break;
} else {// If it is an integer output
If (a % b == 0) {
System.out.println (“”);
System.out.println (i + “.” + A + “/” + b + “=” + (a / b));
                                                                                                                                                                                                                                                                        ; System.out.println(” “);
                                                                                                                                                            .
                  String ss = new DecimalFormat(“0.00”).format(num);
                                                                                        String ss = new DecimalFormat(“0.00”). format(num); br>}
}
Break;
default: // All end
Break;
}
}

}

Running results

Technology Sharing

Technology Sharing

Java addition, subtraction, multiplication and division problems


This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/java-addition-subtraction-multiplication-and-division-problems/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索