项目需求
记录收入支出情况以及剩余金额
项目代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
long money = 0;
String explain = "";
while(true){
System.out.println("——————————欢迎来到小鲨鱼记账系统——————————");
System.out.println("1.收支明细");
System.out.println("2.登记收入");
System.out.println("3.登记支出");
System.out.println("4.退出系统");
Scanner sc = new Scanner(System.in);
System.out.println("———————————————————————————————————————");
System.out.print("请选择数字:");
int num = sc.nextInt();
switch(num){
case 1:
System.out.println("总金额为:"+money);
System.out.print("开支说明:");
System.out.println(explai