软件功能如图
import java.util.Scanner;
public class Demo5 {
public static void main(String[] args) {
int balance = 10000;
String inn =" ";
Scanner scan = new Scanner(System.in);
a:while (true) {
System.out.println("家庭收支记账软件");
System.out.println(" 1.收支明细 ");
System.out.println(" 2.登记收入 ");
System.out.println(" 3.登记指出 ");
System.out.println(" 4.退 出 ");
System.out.println(" 请选择(1-4): ");
int s = scan.nextInt();
switch (s) {
case 2:
System.out.println("请登记收入");
int sr = scan.nextInt();
balance += sr;
String srmx = scan.next();
inn += "金额:"+ sr + " 收入说明: "+srmx+"\n";
break;
case 3:
System.out.println("请登记支出");
int zc = scan.nextInt();
balance -= zc;
String zcmx = scan.next();
inn += "金额:"+ zc+ " 支出说明: "+zcmx+"\n";
break;
case 4:
break a;
case 1:
System.out.println("收支明细");
System.out.println(balance);
System.out.println(inn);
}
}
}
}