subject

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: Determine whether the year is evenly divisible by 100. If it is, then it is a leap year if and only if it is evenly divisible by 400. For example, 2000 is a leap year, but 2100 is not. If the year is not evenly divisible by 100, then it is a leap year if and only if it is evenly 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:

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, shadowsnake
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible. restrictions: branches or loops should not be used. the code must use the internal mod and logical functions. hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible. this is matlab
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, kp2078
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
image
Computers and Technology, 24.06.2019 18:20, 12375819
Use a while-end loop in a script file to calculate the sum of the first n terms of the series: summation sign on the top n bottom k=1 : )^k * k^2 +5k)/3^k show the script file and the two results of n = 10 and n = 20.
Answers: 2
image
Computers and Technology, 24.06.2019 19:20, boyancecristina
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
You know the right answer?
Days in a Month Write a class named MonthDays. The class’s constructor should accept two arguments:...

Questions in other subjects:

Konu
English, 17.07.2019 23:00
Konu
English, 17.07.2019 23:00