SDUT JAVA Lab 5-1 (7-1 sdut-JAVA-Date Validation)

本文介绍了一个Java程序,它接受用户输入的天数、月份和年份,通过validateDate方法检查这些值是否构成有效日期,如超出范围或不符合闰年规则。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

7-1 sdut-JAVA-Date Validation

分数 15

全屏浏览

切换布局

作者 马新娟

单位 山东理工大学

Write a Java application program to accept three numeric values from the end user namely day, month and year. Your program should report whether or not these values constitute a valid date. You should modify your solution so that you accept the values from the end user in your main() method and then pass these values to another method titled validateDate(). The validateDate() method will return true to your main() method if the values constitute a valid date otherwise it will return false. Your main() method should display a message stating whether or not the values constitute a valid date.

Input Specification:

accept three numeric values from the end user namely day, month and year.

Output Specification:

display a message stating whether or not the values constitute a v

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值