用户信息录入系统代码分享(调试了…
2015-04-19 22:57
169 查看
package com;
import java.util.Scanner;
public class Demo5 {
public static void main(String[] args) {
System.out.println("请输入您要录入用户的数量:");
Scanner input=new Scanner(System.in);
int num=input.nextInt();//接受用户数量
int userNum=0000;
boolean a=true;
boolean b=true;
int i=1;//用于记录用户数
int old=0;
int jifen=0;
while(i<=num){
do{
while(a){
System.out.println("请输入第"+i+"用户编号<4位数>:");
userNum=input.nextInt();
if(userNum>9999||userNum<</span>999){
b=true;
}else{
b=false;
}
while(b){
System.out.println("输入错误,请重新输入用户编号:");
userNum=input.nextInt();
if(userNum>9999||userNum<</span>999){
b=true;
}else{
b=false;
}
}
a=false;
}
a=true;
while(a){
System.out.println("请输入用户年龄:");
old=input.nextInt();
if(old<</span>10){
System.out.println("您的年龄小于10周岁,录入失败");
a=false;
i--;
}
a=false;
}
a=true;
if(old<</span>10){ a=false;}
while(a){
System.out.println("输入用户积分:");
jifen=input.nextInt();
a=false;
}
a=true;
if(old<</span>10){ a=false;}
while(a){
System.out.println("------------------------------------------");
System.out.println("|"+"用户编号:"+userNum+"\t"+"用户年龄:"+old+"\t"+"用户积分:"+jifen+"|");
System.out.println("------------------------------------------");
a=false;
}
}while(a);
i++;
a=true;
}
}
}
import java.util.Scanner;
public class Demo5 {
public static void main(String[] args) {
System.out.println("请输入您要录入用户的数量:");
Scanner input=new Scanner(System.in);
int num=input.nextInt();//接受用户数量
int userNum=0000;
boolean a=true;
boolean b=true;
int i=1;//用于记录用户数
int old=0;
int jifen=0;
while(i<=num){
do{
while(a){
System.out.println("请输入第"+i+"用户编号<4位数>:");
userNum=input.nextInt();
if(userNum>9999||userNum<</span>999){
b=true;
}else{
b=false;
}
while(b){
System.out.println("输入错误,请重新输入用户编号:");
userNum=input.nextInt();
if(userNum>9999||userNum<</span>999){
b=true;
}else{
b=false;
}
}
a=false;
}
a=true;
while(a){
System.out.println("请输入用户年龄:");
old=input.nextInt();
if(old<</span>10){
System.out.println("您的年龄小于10周岁,录入失败");
a=false;
i--;
}
a=false;
}
a=true;
if(old<</span>10){ a=false;}
while(a){
System.out.println("输入用户积分:");
jifen=input.nextInt();
a=false;
}
a=true;
if(old<</span>10){ a=false;}
while(a){
System.out.println("------------------------------------------");
System.out.println("|"+"用户编号:"+userNum+"\t"+"用户年龄:"+old+"\t"+"用户积分:"+jifen+"|");
System.out.println("------------------------------------------");
a=false;
}
}while(a);
i++;
a=true;
}
}
}
相关文章推荐
- 方维分享系统模板修改,u_menu.htm调用用户信息
- 用户验证信息邮件自动发送系统代码
- 《信息安全系统设计基础》代码调试分析
- 实现shell终端代码分享(可用户登录 实现系统命令)
- 权限管理系统(用户信息管理模块业务组件实现代码,带注解)
- 实现shell终端代码分享(可用户登录 实现系统命令)
- 地磅称量系统之(27~29)实现主界面显示用户的登录信息和日期时间星期的代码
- 学生信息录入系统java代码
- 方维分享系统二次开发,tip.htm,修改调用的当前用户的信息
- 学生信息管理系统 错误调试及错误总结(2)
- 【Android】用户登录注册界面开发及用户信息管理案例代码详解
- 推荐系统-用户信息数据的采集(1)
- Windows系统 的错误代码信息解释
- linux 操作系统中列出目前与过去登录系统的用户信息last命令的使用
- Postgresql日志系统的实现(一) - Postgres2015全国用户大会--重磅嘉宾佳作分享(李海翔)
- 使用 Python 获取 Linux 系统信息的代码
- “MVC+Nhibernate+Jquery-EasyUI” 信息发布系统 第五篇(用户管理之“用户权限分配”)
- 怎样获得访客的IP,系统,IE版本等信息并显示在IE代码
- 【实验】给指定的并且已登陆系统的用户发信息
- 用bochs调试自己写的系统引导代码