java语言编写基于eclipse控制台运行的计算器小程序
package cn.edu.dzu.calculator;
import java.util.Scanner;
import java.util.regex.Pattern;
public class Z1 {
public static void user() {
Z2 z2 = new Z2();
z2.work();
}
public static void main(String[] args) {
user();
}
}
class Z2{
public void work() {
System.out.println("计算机开始工作………");
int cs = 0;
String checkResult;
String countResult;
String a ,b;
String f;
char c=0;
Scanner scanner = new Scanner(System.in);
while(true) {
cs++;
System.out.println("====================");
System.out.println("第"+cs+"次计算开始………");
System.out.println("请依次输入a、b、f");
System.out.println("a、b为绝对值小于9999.9999的数字,f为1、2、3、4之一");
a=scanner.next();
b=scanner.next();
f=scanner