南岛清风 2021-01-20 23:44 采纳率: 50%
浏览 36
已采纳

java大一学校作业,求助各位大佬。

In this assignment, you will create the User and Validator classes to answer questions about whether the data was entered correctly.

1)     Create class User

2)     This class must contain fields: firstName, secondName, id, age, gender, password, dateOfBirth.

3)     All of the fields must to have Private access modifier.

4)     id should be generated automatically.

5)     Create constructor that accepts these fields

6)     Create setter and getter functions for each field

7)     Create function which prints all fields.

8)     Create class Validator.

9)     Create checkAge method to check if user has full 18.

10)  Create checkPassword method. Password must contain at least 1 uppercase letter, 1 lowercase letter, 1 digit, 1 special symbol(@,$,!,^) and length more or equal to 8.

11)  Create checkDate method. Date should follow dd/mm/yyyy pattern.

12)  Create driver code inside of main() function which allows user to input data in console. All fields cannot be empty. If user entered some field wrong way the program should give an appropriate error.

  • 写回答

6条回答 默认 最新

  • 三石喽 2021-01-21 09:55
    关注

    你是需要代码还是需要翻译,先自己研究一下啊,创建User 和Validator 类总会吧,getter  setter 方法总会吧,上来就把所有的问题扔出来???

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python