https://www.youtube.com/watch?v=mDy_emTwlRg Starting out with Java: From control structures through objects Chapter 6 Programming Challenges 9. Days in a Month Write a class named MonthDays. The class’s constructor should accept two arguments: • An integer for the month (1 = January, 2 = February, etc.). • An integer for the year The class should have a method named getNumberOfDays that returns the number of days in the specified month. The method should use the following criteria to identify leap years: 1. Determine whether the year is divisible by 100. If it is, then it is a leap year if and if only it is divisible by 400. For example, 2000 is a leap year but 2100 is not. 2. If the year is not divisible by 100, then it is a leap year if and if only it is divisible by 4. For example, 2008 is a leap year but 2009 is not. Demonstrate the class in a program that asks the user to enter the month (letting the user enter an integer in the range of 1 through 12) and the year. The program should then display the number of days in that month. Here is a sample run of the program: Enter a month (1-12): 2 [enter] Enter a year: 2008 [enter] 29 days Gaddis, Tony (2015-05-29). Starting Out with Java: From Control Structures through Objects (Page 399). Pearson Education. Kindle Edition. Happy Steeming Everyone! :)
post_id | 1,810,950 |
---|---|
author | kakradetome |
permlink | 6-9-part-2-days-in-a-month-java |
category | programming |
json_metadata | "{"app": "steemit/0.1", "format": "markdown", "links": ["https://www.youtube.com/watch?v=mDy_emTwlRg"], "image": ["https://img.youtube.com/vi/mDy_emTwlRg/0.jpg"], "tags": ["programming", "coding", "java", "days-inamonth", "tony-gaddis"]}" |
created | 2017-01-22 13:51:48 |
last_update | 2017-01-22 13:51:48 |
depth | 0 |
children | 0 |
net_rshares | 57,906,431,985,829 |
last_payout | 2017-02-22 18:27:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 20.544 SBD |
curator_payout_value | 5.725 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,344 |
author_reputation | 31,785,000,472,481 |
root_title | "6.9. (Part 2) Days in a Month - Java" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anonymous | 0 | 271,095,790,651 | 60% | ||
berniesanders | 0 | 10,567,843,467,481 | 73% | ||
penambang | 0 | 5,884,565,077 | 18% | ||
berkah | 0 | 6,474,081,935 | 21% | ||
hello | 0 | 73,128,354,418 | 60% | ||
world | 0 | 27,454,683,419 | 60% | ||
proskynneo | 0 | 6,090,587,707,474 | 73% | ||
val-b | 0 | 11,251,490,476,405 | 73% | ||
fufubar1 | 0 | 39,916,283,019 | 60% | ||
kushed | 0 | 2,722,963,265,189 | 100% | ||
silver | 0 | 639,946,057,317 | 73% | ||
silversteem | 0 | 1,422,100,720,381 | 73% | ||
nextgencrypto | 0 | 3,672,074,869,904 | 73% | ||
rossco99 | 0 | 80,305,783,117 | 18% | ||
wang | 0 | 302,717,032,806 | 73% | ||
jaewoocho | 0 | 2,325,393,621,109 | 73% | ||
boy | 0 | 2,548,488,841 | 100% | ||
xeroc | 0 | 128,034,078,561 | 18% | ||
bue-witness | 0 | 3,103,661,633 | 100% | ||
bunny | 0 | 491,120,394 | 100% | ||
clayop | 0 | 2,806,270,072,046 | 73% | ||
bue | 0 | 49,030,396,241 | 100% | ||
mini | 0 | 1,363,649,333 | 100% | ||
moon | 0 | 173,245,762 | 100% | ||
lovejoy | 0 | 16,484,596,083 | 18% | ||
joseph | 0 | 36,661,137,087 | 21% | ||
biodragon | 0 | 5,025,976,496 | 21% | ||
boatymcboatface | 0 | 36,303,023,966 | 18% | ||
pairmike | 0 | 7,198,576,657 | 18% | ||
idol | 0 | 248,176,115 | 21% | ||
healthcare | 0 | 510,126,812 | 100% | ||
daniel.pan | 0 | 805,490,984 | 100% | ||
donkeypong | 0 | 1,228,157,741,305 | 50% | ||
hcf27 | 0 | 5,568,071,749 | 60% | ||
ash | 0 | 82,099,186,304 | 60% | ||
helen.tan | 0 | 234,113,900 | 100% | ||
jocelyn | 0 | 2,738,737,451 | 21% | ||
acidsun | 0 | 17,296,665,776 | 30% | ||
steemship | 0 | 531,083,039,188 | 60% | ||
blakemiles84 | 0 | 33,267,732,076 | 18% | ||
theshell | 0 | 5,403,955,859 | 18% | ||
coinbitgold | 0 | 111,031,780,015 | 100% | ||
ratel | 0 | 10,989,510,907 | 60% | ||
michaelx | 0 | 3,466,315,006 | 18% | ||
anwenbaumeister | 0 | 547,521,184,690 | 60% | ||
albertogm | 0 | 4,026,511,029 | 18% | ||
tyler-fletcher | 0 | 3,504,496,337 | 60% | ||
clement | 0 | 8,412,735,701 | 60% | ||
isteemit | 0 | 34,701,922,730 | 60% | ||
skapaneas | 0 | 10,390,591,747 | 60% | ||
bacchist | 0 | 42,790,158,580 | 48% | ||
asmolokalo | 0 | 31,804,471,818 | 100% | ||
good-karma | 0 | 23,907,195,479 | 21% | ||
lehard | 0 | 19,615,049,319 | 60% | ||
kakradetome | 0 | 9,616,734,740 | 100% | ||
picokernel | 0 | 7,934,520,579 | 21% | ||
on0tole | 0 | 10,643,115,110 | 60% | ||
anasya | 0 | 22,562,627,004 | 60% | ||
vl248 | 0 | 8,443,541,989 | 60% | ||
sveokla | 0 | 4,929,335,788 | 60% | ||
marinabogumil | 0 | 6,122,342,509 | 60% | ||
anmuravjev | 0 | 2,477,031,746 | 60% | ||
raymondspeaks | 0 | 3,247,687,210 | 60% | ||
kell234 | 0 | 2,000,200,200 | 60% | ||
hyiparena | 0 | 4,563,591,767 | 60% | ||
lichtblick | 0 | 153,502,012,793 | 100% | ||
cryptojoy.com | 0 | 781,672,974 | 60% | ||
konti | 0 | 5,675,592,709 | 60% | ||
phenom | 0 | 2,656,521,624 | 18% | ||
fubar-bdhr | 0 | 25,387,654,258 | 30% | ||
bitcoiner | 0 | 4,129,929,891 | 18% | ||
liberosist | 0 | 136,071,386,303 | 60% | ||
sharker | 0 | 9,073,382,558 | 60% | ||
zaebars | 0 | 52,806,281,185 | 60% | ||
jedau | 0 | 3,444,583,458 | 60% | ||
mondeja | 0 | 3,012,276,839 | 60% | ||
sergey44 | 0 | 474,661,886 | 100% | ||
crypto.owl | 0 | 7,463,330,747 | 60% | ||
pinkisland | 0 | 36,347,503,919 | 100% | ||
bkkshadow | 0 | 4,938,359,861 | 60% | ||
smailer | 0 | 43,087,501,020 | 60% | ||
dmilash | 0 | 15,250,607,140 | 60% | ||
gomeravibz | 0 | 34,211,316,751 | 60% | ||
litrbooh | 0 | 2,392,210,542 | 60% | ||
craigslist | 0 | 345,851,658 | 100% | ||
nekromarinist | 0 | 21,623,507,202 | 60% | ||
always1success | 0 | 5,202,841,484 | 60% | ||
brendio | 0 | 9,507,921,356 | 14.4% | ||
asdes | 0 | 4,368,722,328 | 60% | ||
mama-steem | 0 | 1,562,811,639 | 60% | ||
uuuhha | 0 | 12,841,095,696 | 60% | ||
romancs | 0 | 2,989,439,399 | 60% | ||
bigsambucca | 0 | 385,115,995 | 60% | ||
steemradio | 0 | 446,642,041 | 60% | ||
randyclemens | 0 | 11,397,377,556 | 60% | ||
krishtopa | 0 | 60,001,620,127 | 60% | ||
villainblack | 0 | 5,608,574,512 | 60% | ||
cmorton | 0 | 423,924,584 | 7.2% | ||
numberone | 0 | 4,492,849,785 | 60% | ||
virtualgrowth | 0 | 1,107,767,427 | 3% | ||
imag1ne | 0 | 2,132,588,912 | 60% | ||
leno4ek | 0 | 1,234,147,421 | 60% | ||
nulliusinverba | 0 | 905,253,793 | 18% | ||
sharingeverybite | 0 | 41,258,287,534 | 100% | ||
shenanigator | 0 | 306,368,161,417 | 100% | ||
nadin3 | 0 | 6,032,056,504 | 60% | ||
xanoxt | 0 | 21,861,281,898 | 60% | ||
victoriart | 0 | 9,592,911,613 | 60% | ||
l0k1 | 0 | 18,658,324,574 | 60% | ||
maryfromsochi | 0 | 2,205,984,451 | 60% | ||
tatianka | 0 | 2,184,897,689 | 60% | ||
thecyclist | 0 | 1,358,240,883,981 | 73% | ||
zettar | 0 | 1,347,464,440 | 60% | ||
jacobts | 0 | 1,208,316,761 | 18% | ||
elena-singer | 0 | 5,569,317,612 | 60% | ||
renzoarg | 0 | 9,026,706,271 | 60% | ||
tracemayer | 0 | 4,830,814,035 | 18% | ||
burnin | 0 | 7,769,438,106 | 60% | ||
anton333 | 0 | 5,773,461,256 | 60% | ||
steemsquad | 0 | 1,536,404,921 | 60% | ||
ekaterinka | 0 | 2,009,810,940 | 60% | ||
develcuy | 0 | 3,428,748,277 | 60% | ||
borishaifa | 0 | 6,867,568,670 | 60% | ||
mapalatv | 0 | 1,522,658,072 | 60% | ||
meerkat | 0 | 5,755,290,175 | 21% | ||
thegame | 0 | 207,469,982 | 3% | ||
steembets | 0 | 210,705,640 | 3% | ||
crimson | 0 | 615,981,396 | 73% | ||
curie | 0 | 435,366,571,414 | 60% | ||
htyfn | 0 | 2,296,412,259 | 60% | ||
rusteemitblog | 0 | 5,677,866,781 | 60% | ||
therajmahal | 0 | 1,846,957,174 | 60% | ||
hendrikdegrote | 0 | 6,957,508,036,877 | 73% | ||
marel | 0 | 1,306,781,330 | 60% | ||
steemlift | 0 | 2,914,401,416 | 60% | ||
galveston | 0 | 3,618,590,834 | 73% | ||
oshima | 0 | 494,124,812 | 73% | ||
ianboil | 0 | 1,579,007,087 | 60% | ||
zatrhas | 0 | 1,616,128,000 | 30% | ||
zathras | 0 | 2,145,437,028 | 30% | ||
steemspeak | 0 | 225,882,079 | 2% | ||
fyrst-witness | 0 | 353,631,522 | 2% | ||
max-max | 0 | 3,185,857,305 | 60% | ||
garvofe | 0 | 3,577,120,600 | 60% | ||
steemland.com | 0 | 210,275,180 | 3% | ||
adelja | 0 | 1,395,646,576 | 100% | ||
xer | 0 | 1,470,069,818 | 21% | ||
sqube | 0 | 5,902,161,533 | 3% | ||
catto000 | 0 | 6,185,232,370 | 73% | ||
teukumukhlis | 0 | 1,070,486,971 | 60% | ||
steemprentice | 0 | 2,260,348,435 | 3% | ||
reisman | 0 | 2,889,033,538 | 100% | ||
engagement | 0 | 2,509,232,363,693 | 73% | ||
killuminatic | 0 | 318,639,246 | 60% | ||
tonicbbleking | 0 | 941,291,018 | 60% | ||
leongkhan | 0 | 279,975,737 | 60% | ||
tamersameeh | 0 | 99,551,233 | 21% | ||
beerbot | 0 | 1,489,022,337 | 30% | ||
loreennaa | 0 | 2,246,805,739 | 100% | ||
blockained | 0 | 137,698,278 | 60% | ||
blockchained | 0 | 194,683,731 | 60% | ||
marco.world | 0 | 137,698,228 | 60% | ||
robertneleson | 0 | 549,743,779 | 60% | ||
vrezh | 0 | 160,193,962 | 60% |