Package com;
Import Java.util.Scanner;
public class Hehe {
Scanner input = new Scanner (system.in);
String name[] = new STRING[10];
int age[] = new INT[10];
int jifen[] = new INT[10];
int Xiaoyu;
int Dayu;
String JIXV;
int A;
String b;
String Quer;
int mima1;
int Mima;
int mima2;
int mima3;
int mima4;
String naem1;
String name1;
public void Main () {
SYSTEM.OUT.PRINTLN ("System login" +
"\n1. Login function" +
"\n2. Registration" +
"\N3. Modify Administrator Password" +
"\n4. Exit \n****************************************************************************" +
"\ n Please select input:");
int a = Input.nextint ();
Switch (a) {
Case 1:
DL ();
Break
Case 2:
Zhuce1 ();
Break
Case 3:
Xiugai ();
Break
Case 4:
System.out.println ("Thank you for your use!") ");
break;
}
}
public void dl () {
if (naem1!=null) {
System.out.println ("Please enter account:");
Name1=input.next ();
System.out.println ("Please enter password:");
Mima3=input.nextint ();
while (!name1.equals (naem1) | | mima3!=mima1) {
System.out.println ("Input Error! Unable to login!! ");
System.out.println ("Please enter again!") ");
System.out.println ("Please enter your account:");
Name1=input.next ();
System.out.println ("Please enter password:");
Mima3=input.nextint ();
}
System.out.println ("Login successful!!" +
"\n****************************************************************** **********");
DD (); else{
System.out.println ("No registration, please REGISTER FIRST!!!" "+
" \n**************************************************************************** ");
Main ();
}
}
public void DD () {
System.out.println ("1. Show all member information" +
"\n2. Statistics member Age level" +
"\N3. Add member Information" +
"\n4. Search for Loyalty points" +
"\N5. System Integration Annual Upgrade" +
"\n6. Exit \n****************************************************************************" +
"\ n Please select input:");
int b = Input.nextint ();
Switch (b) {
Case 1:
CC ();
Break
Case 2:
b ();
Break
Case 3:
C ();
Break
Case 4:
D ();
Break
Case 5:
System.out.println ("Annual points Upgrade! ");
Break
Case 6:
Main ();
Break
Default
SYSTEM.OUT.PRINTLN ("Input error, re-enter" +
"\n*****************************************");
DD ();
Break
}
}
public void cc () {
for (int i = 0; i < name.length; i++) {
if (null = = (Name[0])) {
System.out.println ("No member information, please add and then to inquire");
DD ();
} else {
if (null! = (Name[i])) {
System.out.println (Name[i] + "\ T" + age[i] + "\ T"
+ jifen[i]);
} else {
DD ();
}
}
}
}
public void B () {
for (int i = 0; i < age.length; i++) {
if (age[0] = = 0) {
System.out.println ("Please add First");
DD ();
} else {
if (age[i] = = 0) {
break;
} else {
if (< Age[i]) {
Xiaoyu = Xiaoyu + 1;
} else {
D Ayu = Dayu + 1;
}
}
}
}
System.out.println ("with" + Xiaoyu under 20 years of age);
System.out.println ("20 years old and above" + Dayu);
DD ();
}
public void C () {
System.out.println ("Add member Information");
for (int i = 0; i < name.length; i++) {
if (name[i] = = null) {
System.out.println ("input name");
Name[i] = Input.next ();
System.out.println ("Age");
Age[i] = Input.nextint ();
System.out.println ("integral");
Jifen[i] = Input.nextint ();
System.out.println ("Whether or not to continue: (y/n)");
JIXV = Input.next ();
if ("Y". Equals (JIXV)) {
continue;
} else {
dd ();
}
}
}
}
public void D () {
for (int i = 0; i < age.length; i++) {
if (age[0] = = 0) {
SYSTEM.OUT.PRINTLN ("Please add first");
DD ();
} else{
System.out.println ("Enter member name");
b = Input.next ();
for (int j = 0; i < name.length; i++) {
if (B.equals (Name[j])) {
System.out.println ("Points are:" + jifen[j]);
}
}}
DD ();
}
}
public void Xiugai () {
if (naem1!=null) {
SYSTEM.OUT.PRINTLN ("Modify Administrator");
System.out.println ("Please enter the original password");
Mima2=input.nextint ();
SYSTEM.OUT.PRINTLN ("Confirm password Again");
Mima=input.nextint ();
if (MIMA==MIMA1) {
System.out.println ("Please enter a new password:");
Mima4=input.nextint ();
MIMA1=MIMA4;
SYSTEM.OUT.PRINTLN ("Password modified successfully!") ");
Main ();
}else{
SYSTEM.OUT.PRINTLN ("Password input error!!!!" +
"\n****************************");
Main ();
}
}else{
SYSTEM.OUT.PRINTLN ("Cannot be modified! ");
Main ();
}
}
public void Zhuce1 () {
if (naem1!=null) {
System.out.println ("You are already registered! ");
Main ();
}else{
System.out.println ("Enter user name");
Naem1=input.next ();
System.out.println ("Enter password");
Mima1=input.nextint ();
SYSTEM.OUT.PRINTLN ("Confirm Password (y/n)");
Quer=input.next ();
if ("Y". Equals (Quer)) {
SYSTEM.OUT.PRINTLN ("registered success");
Main ();
}else{
while (! " Y ". Equals (Quer)) {
System.out.println ("Enter user name");
Naem1=input.next ();
System.out.println ("Enter password");
Mima1=input.nextint ();
SYSTEM.OUT.PRINTLN ("Confirm Password (y/n)");
Quer=input.next ();
}
SYSTEM.OUT.PRINTLN ("registered success");
Main ();
}
}
}
}
Package com;
public Class AA {
public static void Main (string[] args) {
Hehe kk=new hehe ();
Kk.main ();
}
}
Book Management system of the 17th chapter