-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFamilyAccountRecord.java
More file actions
51 lines (47 loc) · 1.51 KB
/
FamilyAccountRecord.java
File metadata and controls
51 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//https://www.bilibili.com/video/BV18b411t7Nc?p=127
package bzhan;/**
* @Classname FamilyAccountRecord
* @Description TODO
* @Date 2021/1/27 15:13
* @Created by wangxutao
*/
import com.sun.xml.internal.ws.addressing.WsaTubeHelperImpl;
import jdk.nashorn.internal.ir.WhileNode;
import sun.text.normalizer.Utility;
import javax.activation.MailcapCommandMap;
import javax.rmi.CORBA.Util;
import java.util.*;
class readchar{
static char readchar_fromBoard(){
char ch='a';
while (true) {
Scanner sc=new Scanner(System.in);
String c=sc.nextLine();
if (c.length()!= 1) {
System.out.println("wrong input,1 char please !\n ");
}
else {
ch = c.charAt(0);
break;}
}
return ch;
}
}
public class FamilyAccountRecord {
public static void main(String[] args) {
boolean isflag = true;
while (isflag) {
System.out.println("**********家庭收入说明*********");
System.out.println(" 1收支明细");
System.out.println(" 2点击收入");
System.out.println(" 3等级支出");
System.out.println(" 4退 出\n");
System.out.println("请输入选择1-4");
char c = readchar.readchar_fromBoard();
if (c!='1'&&c!='3'&&c!='2'&&c!='4') {
System.out.println("bad select,select again");
}else {
break;
}
}
}}