一个月的日子 [英] Days in a month

查看:72
本文介绍了一个月的日子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbeans作为编译器。

我必须处理一个项目,用户可以确定特定年份每个月的天数。

我已经知道如何提示用户输入他们的选择,但我对如何设置计算感到有点困惑。

我会假设我必须在字符串中设置月份?每个月都必须是一个int?

我想我必须使用很多if,否则if语句。


这对任何人都有意义吗?我不是要求任何人做我的作业,这是不道德的,但任何插入,提示,建议都会受到欢迎。

谢谢。

解决方案

你知道吗 GregorianCalendar ????


亲切问候。

dmjpro。


你好,

我正在写代码来解决你的问题:


<代码被管理员删除>


我正在使用Netbeans作为编译器。



< nitpickymode>

Nebeans不是编译器:它是一个IDE。

< ; / nitpickymode>


...


这对任何人都有意义吗?我不是要求任何人做我的作业,这是不道德的,但任何插入,提示,建议都会受到欢迎。

谢谢。



是的,这是有道理的。您已完成任务中最困难的部分:输入部分。所以这里提示你如何完成它:

展开 | 选择 | Wrap | 行号


I''m using Netbeans as a complier.
I have to work on a project where a user can determine how many days are in each month in a particular year.
I already know how to prompt the user to enter their choices, but I''m feeling a little confused on how to set up the calculations.
I would assume I would have to set the months in a string? each month would have to be an int?
and I''m thinking I''ll have to use a lot of if, else if statements too.

Does this make sense to anyone? I am not asking for anyone to do my homework, that is unethical, but any imput, tips, advice would be most welcomed.
Thank you.

解决方案

do u know GregorianCalendar????

kind regards.
dmjpro.


Hi There,
I am writing the code that would solve ur problem :

<Code removed by admin>


I''m using Netbeans as a complier.

<nitpickymode>
Nebeans is not a compiler: it''s an IDE.
</nitpickymode>


...

Does this make sense to anyone? I am not asking for anyone to do my homework, that is unethical, but any imput, tips, advice would be most welcomed.
Thank you.

Yes, it makes sense. You already have the most difficult part of the assignment done: the input-part. So here''s a hint as to how you could finish it:

Expand|Select|Wrap|Line Numbers


这篇关于一个月的日子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆